rake db:load不起作用

时间:2013-04-08 18:04:02

标签: ruby-on-rails database rake-task

我在Ruby中完全没有人,我无法执行命令rake db:load。抱歉愚蠢的问题,但我需要帮助。 rake db:seed

会引发同样的错误
root@root:/var/www/dir# rake db:load --trace
rake aborted!
Don't know how to build task 'db:load'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.4/lib/rake/task_manager.rb:49:in `[]'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:142:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:101:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:73:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-10.0.4/bin/rake:33
/usr/bin/rake:23:in `load'
/usr/bin/rake:23

1 个答案:

答案 0 :(得分:1)

这个项目存在两个问题。首先,它缺少Javascript运行时。您可以通过添加

来解决此问题
gem 'execjs'
gem 'therubyracer'

到GemFile并重新运行

bundle install

第二个问题是没有指定db:load任务。查看您要使用的代码

bundle exec rake db:schema:load

这应该有效。