耙子流产! Rails无法生成

时间:2015-05-07 12:14:11

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

我正在学习rails并逐步使用lynda视频系列。 我试过耙子。它给出了以下错误。

$ rake generate migration DoNothingYet 
rake aborted!
Don't know how to build task 'generate'

我用--trace来查找问题。但是,它并没有指出错误。

$ rake generate migration DoNothingYet --trace
rake aborted!
Don't know how to build task 'generate'
/Users/boss/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/task_manager.rb:62:in `[]'
/Users/boss/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:149:in `invoke_task'
/Users/boss/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/boss/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in `each'
/Users/boss/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
/Users/boss/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
/Users/boss/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
/Users/boss/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
/Users/boss/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/Users/boss/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/Users/boss/.rbenv/versions/2.2.2/bin/rake:33:in `<main>'

1 个答案:

答案 0 :(得分:5)

您应该使用rails命令,而不是rake

rails generate migration DoNothingYet
祝你好运!