1
~/Rails Projects/QA-app$ rake db:drop
rake aborted!
Gem::LoadError: You have already activated rake 10.3.2, but your Gemfile requires rake 10.1.1. Using bundle exec may solve this.
/home/salmanalam/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `block in setup'
/home/salmanalam/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:19:in `setup'
/home/salmanalam/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
/home/salmanalam/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/setup.rb:7:in `<top (required)>'
/home/salmanalam/Rails Projects/QA-app/config/boot.rb:4:in `<top (required)>'
/home/salmanalam/Rails Projects/QA-app/config/application.rb:1:in `<top (required)>'
/home/salmanalam/Rails Projects/QA-app/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
5
  • Can someone tell me what happened? And what can I do to get rid of this problem? Commented Jun 3, 2014 at 0:56
  • 2
    Try running it under bundle exec like it says? Seems a good place to start. Commented Jun 3, 2014 at 0:57
  • 1
    It says "Using bundle exec may solve this." so try bundle exec rake db:drop Commented Jun 3, 2014 at 0:58
  • I tried with bundle exec it did work, but seems like I have to enter bundle exec every time. Any answers to that? Commented Jun 3, 2014 at 1:08
  • Remove the non-bundle rake gem and install the version from the Gemfile. Commented Jun 3, 2014 at 1:13

4 Answers 4

2

Run the command using bundle exec(bundle exec rake db:drop) to force the version of rake that is used by your application.

Sign up to request clarification or add additional context in comments.

Comments

2

Just run `bundle update and update your app. The version of Rake that it is looking for is 10.1.1 but your version of Rake has already been updated to 10.3.2

Comments

1

You can't just go updating all gems willy nilly on a larger project without running into problems. If you don't want to have to prefix bundle exec, then just run bundle update rake.

Comments

0

This is what worked for me:

rm -rf Gemfile.lock

Then run bundle install if needed, and rake db:(whatever) goes without error.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.