耙不知道如何建立任务

时间:2015-03-02 15:43:49

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

我有一个名为

的rake任务
  

myapi.rake

该文件的内容如下:

require 'active_record'
namespace :myapi do
  task :populate_terminals do
    #My model and it's method
    Terminnal.populate
  end
end

当我运行bundle exec rake myapi时,我收到以下错误:

  

不知道如何构建任务myapi

当我做一个捆绑exec rake myapi --trace时,这就是我得到的

  

/home/myuser/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/task_manager.rb:49:in   []' ebâ/home/myuser/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:148:in invoke_task&#39;   /home/myuser/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in   block (2 levels) in top_level' /home/myuser/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in 各&#39;   /home/myuser/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:in   block in top_level' /home/myuser/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:115:in run_with_threads&#39;   /home/myuser/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:100:in   top_level' /home/myuser/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:78:in 阻止运行&#39;   /home/myuser/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:165:in   standard_exception_handling' /home/myuser/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:75:in 运行&#39;   /home/myuser/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rake-10.1.0/bin/rake:33:in   <top (required)>' /home/myuser/.rbenv/versions/1.9.3-p448/bin/rake:23:in负载&#39; $   /home/myuser/.rbenv/versions/1.9.3-p448/bin/rake:23:in`&#39;

感谢您在调试时提供的任何帮助。 stackoverflow中有一些类似的问题,但推荐的解决方案似乎都不起作用。

以上错误是否会产生误导,问题出现在我的代码中?

0 个答案:

没有答案