我最近安装了Rails 3.1,现在我的旧的Rails 3.0应用无法运行rake db:migrate命令。当我尝试运行bundle exec rake db:migrate
时,会出现以下情况。我使用Ubuntu操作系统,并没有安装RVM。
/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)
哪个版本的rake
/usr/local/bin/rake
gem' rake','>=0.9.2'
,然后运行bundle update
。 - Tilo:require => false
,通常情况下你不需要一直 require rake。 - Marian Theisen