2011-05-25 166 views
1

當我嘗試在heroku上運行rake命令時發生此錯誤。我正在使用Rails 3.0.7Heroku Rake遷移

**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' 

回答

3

這是最近發佈的rake 0.9.0的一個錯誤。 有幾種解決方法,但我建議你現在降級到耙0.8.7。

在你的Gemfile添加

gem 'rake', '~> 0.8.7' 

然後運行

$ bundle update rake 

和承諾。

+0

修復了對我來說完全相同的問題+1優秀。 – automagic 2011-05-28 02:34:59