Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rake db:migrate is being aborted due to rake version difference [duplicate]

I am getting the error

rake db:migrate --trace
rake aborted!
You have already activated rake 10.1.1, but your Gemfile requires rake 10.1.0. Using bundle exec may solve this.
/Users/iang/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `block in setup'
/Users/iang/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:19:in `setup'
/Users/iang/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
/Users/iang/.rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/setup.rb:7:in `<top (required)>'
/Users/iang/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:116:in `require'
/Users/iang/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:116:in `rescue in require'
/Users/iang/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:122:in `require'
/Users/iang/code/Projects/work/startco/config/boot.rb:4:in `<top (required)>'
/Users/iang/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in `require'
/Users/iang/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in `require'
/Users/iang/code/Projects/work/startco/config/application.rb:1:in `<top (required)>'
/Users/iang/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in `require'
/Users/iang/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in `require'
/Users/iang/code/Projects/work/startco/Rakefile:4:in `<top (required)>'
/Users/iang/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in `load'
/Users/iang/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in `load_rakefile'
/Users/iang/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.1/lib/rake/application.rb:637:in `raw_load_rakefile'
/Users/iang/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.1/lib/rake/application.rb:94:in `block in load_rakefile'
/Users/iang/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/iang/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.1/lib/rake/application.rb:93:in `load_rakefile'
/Users/iang/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.1/lib/rake/application.rb:77:in `block in run'
/Users/iang/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/iang/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
/Users/iang/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
/Users/iang/.rvm/gems/ruby-2.0.0-p247/bin/rake:23:in `load'
/Users/iang/.rvm/gems/ruby-2.0.0-p247/bin/rake:23:in `<main>'

used bundle and it did not fix the problem... any ideas as to help fix this problem?

like image 476
iang Avatar asked Dec 21 '13 02:12

iang


3 Answers

I hit the same error. Running bundle update solved it.

Update: As suggested by TuK bundle update rake is the way to go.

like image 105
Andreas Baumgart Avatar answered Nov 13 '22 09:11

Andreas Baumgart


You want to use bundle exec:

bundle exec rake db:migrate

Or, if you're using Rails 4 binstubs:

./bin/rake db:migrate
like image 32
sethvargo Avatar answered Nov 13 '22 08:11

sethvargo


I got this error message while deploying to production with capistrano. To fix it I executed the following on my production server:

gem update rake
like image 29
laertiades Avatar answered Nov 13 '22 09:11

laertiades