当我尝试在heroku上运行rake命令时会发生此错误。我正在使用Rails 3.0.7
**D:\Product\agent360>** heroku rake --trace db:migrate VERSION=20110513084747
rake aborted!
undefined method `task' for #<Final::Application:0x7fc0f63088b0>
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/application.rb:139:in `load_tasks'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/application.rb:77:in `send'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
/app/Rakefile:7
/app/.bundle/gems/ruby/1.8/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load'
/app/.bundle/gems/ruby/1.8/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/app/.bundle/gems/ruby/1.8/gems/rake-0.9.0/lib/rake/application.rb:495:in `raw_load_rakefile'
/app/.bundle/gems/ruby/1.8/gems/rake-0.9.0/lib/rake/application.rb:78:in `load_rakefile'
/app/.bundle/gems/ruby/1.8/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handli
ng'
答案 0 :(得分:3)
这是最近发布的rake 0.9.0
的错误。
有几种解决方法,但是我建议你现在降级到0.8.7。
在你的Gemfile中添加
gem 'rake', '~> 0.8.7'
然后运行
$ bundle update rake
并提交。