Heroku 耙子错误
当我在 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>'
我该如何解决这个问题?
When I run rake db:migrate
on Heroku, I get an error. I have no problems running it locally.
This works fine:
C:\unaton>rake db:migrate
But when I use
C:\unaton>heroku rake db:migrate
then I get the following error.
(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>'
How do I fix this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
升级到rails 3.0.9或将其添加到Gemfile
gem“rake”,“0.8.7”
Either upgrade to rails 3.0.9 or add this to the Gemfile
gem "rake", "0.8.7"
来自 http://softwaregravy.com/rake-not-backwards-company/
From http://softwaregravy.com/rake-not-backwards-compatible/