我有一个名为
的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' /home/myuser/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:inblock (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
各' /home/myuser/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:106:inblock 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' /home/myuser/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:100:intop_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
阻止运行' /home/myuser/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/rake-10.1.0/lib/rake/application.rb:165:instandard_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中有一些类似的问题,但推荐的解决方案似乎都不起作用。
以上错误是否会产生误导,问题出现在我的代码中?