public
Created

Ruby 1.9.3p0 Rails 3.1.3 Rake 0.9.2.2 breaks on rake db:migrate

  • Download Gist
log
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
pax@ubuntu:~/projects/missionhub$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]
pax@ubuntu:~/projects/missionhub$ rails -v
Rails 3.1.3
pax@ubuntu:~/projects/missionhub$ rake -V
rake, version 0.9.2.2
pax@ubuntu:~/projects/missionhub$ bundle exec rake db:migrate --trace
DEPRECATION WARNING: Yajl's JSON gem compatibility API is going to be removed in 2.0
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:schema:dump
/home/pax/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:167:in `block in non_options': file not found: db:migrate (ArgumentError)
from /home/pax/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:146:in `map!'
from /home/pax/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:146:in `non_options'
from /home/pax/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:207:in `non_options'
from /home/pax/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:52:in `process_args'
from /home/pax/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/minitest/unit.rb:891:in `_run'
from /home/pax/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/minitest/unit.rb:884:in `run'
from /home/pax/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:21:in `run'
from /home/pax/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:326:in `block (2 levels) in autorun'
from /home/pax/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:27:in `run_once'
from /home/pax/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:325:in `block in autorun'
 
#-----------------------------
 
pax@ubuntu:~/projects/missionhub$ ruby -v
ruby 1.9.2p271 (2011-05-31 revision 31856) [i686-linux]
pax@ubuntu:~/projects/missionhub$ rails -v
Rails 3.1.3
pax@ubuntu:~/projects/missionhub$ bundle exec rake -V
rake, version 0.9.2.2
 
pax@ubuntu:~/projects/missionhub$ bundle exec rake db:migrate
DEPRECATION WARNING: Yajl's JSON gem compatibility API is going to be removed in 2.0
Loaded suite /home/pax/.rvm/gems/ruby-1.9.2-p180@missionhub/bin/rake
Started
 
Finished in 0.001118 seconds.
 
0 tests, 0 assertions, 0 failures, 0 errors, 0 skips
 
Test run options: --seed 51475

It seems that most rake db tasks fail. Tasks don't break when using Ruby 1.9.2.

Hello,

I'm not sure that would help a lot, but I got the same issue with Ruby 1.9.3p0, Rails 3.0.11, Rake 0.9.2.2 on every tasks when RAILS_ENV is set to "test". And like in your example, it works with Rails 1.9.2.

brice@thalie:~/dev/ekylibre$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
brice@thalie:~/dev/ekylibre$ rails -v
Rails 3.0.11
brice@thalie:~/dev/ekylibre$ rake -V
rake, version 0.9.2.2
brice@thalie:~/dev/ekylibre$ rake about
/home/brice/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `block in require': iconv will be deprecated in the future, use String#encode instead.
About your application's environment
Ruby version              1.9.3 (x86_64-linux)
RubyGems version          1.8.10
Rack version              1.2
Rails version             3.0.11
Active Record version     3.0.11
Action Pack version       3.0.11
Active Resource version   3.0.11
Action Mailer version     3.0.11
Active Support version    3.0.11
Middleware                ActionDispatch::Static, Rack::Lock, ActiveSupport::Cache::Strategy::LocalCache, Rack::Runtime, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::RemoteIp, Rack::Sendfile, ActionDispatch::Callbacks, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActiveRecord::SessionStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, Rack::MethodOverride, ActionDispatch::Head, ActionDispatch::BestStandardsSupport
Application root          /home/brice/dev/ekylibre
Environment               development
Database adapter          postgresql
Database schema version   20101123095131
brice@thalie:~/dev/ekylibre$ rake about RAILS_ENV=test
/home/brice/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `block in require': iconv will be deprecated in the future, use String#encode instead.
About your application's environment
Ruby version              1.9.3 (x86_64-linux)
RubyGems version          1.8.10
Rack version              1.2
Rails version             3.0.11
Active Record version     3.0.11
Action Pack version       3.0.11
Active Resource version   3.0.11
Action Mailer version     3.0.11
Active Support version    3.0.11
Middleware                ActionDispatch::Static, Rack::Lock, ActiveSupport::Cache::Strategy::LocalCache, Rack::Runtime, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::RemoteIp, Rack::Sendfile, ActionDispatch::Callbacks, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActiveRecord::SessionStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, Rack::MethodOverride, ActionDispatch::Head, ActionDispatch::BestStandardsSupport
Application root          /home/brice/dev/ekylibre
Environment               test
Database adapter          postgresql
Database schema version   20101123095131
/home/brice/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:167:in `block in non_options': file not found: about (ArgumentError)
    from /home/brice/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:146:in `map!'
    from /home/brice/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:146:in `non_options'
    from /home/brice/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:207:in `non_options'
    from /home/brice/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:52:in `process_args'
    from /home/brice/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/minitest/unit.rb:891:in `_run'
    from /home/brice/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/minitest/unit.rb:884:in `run'
    from /home/brice/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:21:in `run'
    from /home/brice/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:326:in `block (2 levels) in autorun'
    from /home/brice/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:27:in `run_once'
    from /home/brice/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit.rb:325:in `block in autorun'

Hey,

I figured that with regards to tasks, db migration etc., 1.9.3 looks like it blew up and failed to finish the task but it actually completed.
I tried to do rake db:migrate on mine, it still showed the same 'block in non_options' error but actually it finished the migration.

Have you seen this?
https://github.com/jimweirich/rake/issues/51

I still haven't found a way to fix these errors though.

Like beanieboi, I used shoulda which produces this error. I found that the require 'test/unit' call used in shoulda 2.11.3 and shoulda-context re-runs tests on Ruby 1.9.3. If I comment this line, it seems to work (I tested that with shoulda only).

For now, I fixed the issue by removing shoulda from my Gemfile and by including the code I need from shoulda-context. It's quite ugly, but I'll try to find a better way.

Thank you for the link which helps me.

I have the same problem and have verified it's a problem with shoulda interaction.

I also ran into this issue - removing shoulda fixed it. Many thanks!

It's worth pointing out that declaring :require => false in your Gemfile will avoid this problem:

gem "shoulda", :require => false

Then just make sure you require "shoulda" in your spec helper file.

Yes. It helped! Thank you!

This was helpful. Thank you!

cool~ flavorjones' solution works quite well.

I ran into this issue with flexmock as well--same fix

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.