6
我最近安裝了Rails 3.1,現在我的舊Rails 3.0應用程序不會rake db:migrate。這是當我嘗試運行bundle exec rake db:migrate
時發生的情況。我在Ubuntu沒有RVMbundle exec rake db:migrate cause「找不到可執行的rake」錯誤
/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/shared_helpers.rb:142:in `block in cripple_rubygems': can't find executable rake (Gem::Exception)
from /usr/local/lib/ruby/gems/1.9.1/bin/rake:19:in `<main>'
當我跑得rake db:migrate
,它輸出:
rake aborted!
You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.8.7. Consider using bundle exec.
(See full trace by running task with --trace)
其耙
/usr/local/bin/rake
我在Ubuntu上沒有RVM –
gem list | rake輸出: 您已經激活了rake 0.9.2.2,但您的Gemfile需要rake 0.8.7。考慮使用bundle exec。 –
好吧,那很簡單!較早的Rake版本與Rails 3.1.1不兼容 - 您需要增加Gemfile中rake的版本號!把它放在你的Gemfile中:'gem'rake','> = 0.9.2',並做一個'bundle update' ' – Tilo