~/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)
答案 0 :(得分:2)
使用bundle exec(bundle exec rake db:drop
)运行该命令以强制应用程序使用的rake版本。
答案 1 :(得分:2)
只需运行`bundle update并更新你的应用。它正在寻找的Rake版本是10.1.1,但您的Rake版本已经更新为10.3.2
答案 2 :(得分:1)
你不能在一个更大的项目上毫不费力地更新所有宝石而不会遇到问题。如果您不想使用bundle exec
作为前缀,那么只需运行bundle update rake
。
答案 3 :(得分:0)
这对我有用:
rm -rf Gemfile.lock
然后根据需要运行bundle install
,rake db:(whatever)
无错误。