Heroku耙错误

时间:2011-06-16 13:09:20

标签: ruby-on-rails-3 heroku rake dbmigrate

当我在Heroku上运行rake db:migrate时,出现错误。我在本地运行它没有问题。

这很好用:

C:\unaton>rake db:migrate

但是当我使用

C:\unaton>heroku rake db:migrate

然后我收到以下错误。

(in /app)
rake aborted!
uninitialized constant Rake::DSL
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:8:in `<class:Ta
skLib>'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:6:in `<module:R
ake>'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:3:in `<top (req
uired)>'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/rdoctask.rb:20:in `<top (r
equired)>'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.7/lib/rails/tasks/documentation.r
ake:1:in `<top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.7/lib/rails/tasks.rb:15:in `block
 in <top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.7/lib/rails/tasks.rb:6:in `each'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.7/lib/rails/tasks.rb:6:in `<top (
required)>'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:214:in
 `initialize_tasks'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:139:in
 `load_tasks'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:77:in
`method_missing'
/app/Rakefile:7:in `<top (required)>'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `load'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1991:in `run'
/usr/ruby1.9.2/bin/rake:31:in `<main>'

如何解决此问题?

2 个答案:

答案 0 :(得分:7)

升级到rails 3.0.9或将其添加到Gemfile

gem“rake”,“0.8.7”

答案 1 :(得分:0)

来自http://softwaregravy.com/rake-not-backwards-compatible/

  

这是错误:

     耙子流产了!未初始化的常数   耙:: DSL   /usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2482:in   const_missing' /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.1/lib/rake/tasklib.rb:8:in ”   /app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.1/lib/rake/tasklib.rb:6:in   `'

     

在你的Gemfile中将rake拉到0.8.7

     

gem'rake','0.8.7'

     

注意,你可能已经被锁定了   进入0.9.X,所以你需要做一个:

     

捆绑更新rake