当我尝试更新Heroku数据库时,为什么会出现错误?
每当我尝试任何heroku rake
...命令时,我都会得到同样的错误:
$ heroku rake db:setup
(in /app)
rake aborted!
uninitialized constant Rake::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.2/lib/rake/tasklib.rb:8:in `<class:TaskLib>'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:6:in `<module:Rake>'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/tasklib.rb:3:in `<top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/rdoctask.rb:20:in `require'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2/lib/rake/rdoctask.rb:20:in `<top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/tasks/documentation.rake:1:in `require'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/tasks/documentation.rake:1:in `<top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/tasks.rb:15:in `load'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/tasks.rb:15:in `block in <top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/tasks.rb:6:in `each'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/tasks.rb:6:in `<top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/application.rb:215:in `require'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/application.rb:215:in `initialize_tasks'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/lib/rails/application.rb:139:in `load_tasks'
/app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.8/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>'
答案 0 :(得分:1)
Rakefile应该包括
require 'rake/dsl_definition'
答案 1 :(得分:0)
有两种方法可以解决这个问题。我在这里有一篇关于它的博客文章:
使用较旧的rake版本,或者需要DSL用于较新的gem。
http://codeglot.com/posts/13-you_have_already_activated_rake_0_9_2
答案 2 :(得分:0)