我跑步时收到此错误:
rake generate_secret_token
rake aborted!
Don't know how to build task 'generate_secret_token'
/usr/local/rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
当我运行完整的跟踪
rake generate_secret_token --trace
这就是我所得到的;
/usr/local/rvm/gems/ruby-2.1.3/gems/rake-10.4.2/lib/rake/task_manager.rb:62:in `[]'
/usr/local/rvm/gems/ruby-2.1.3/gems/rake-10.4.2/lib/rake/application.rb:149:in `invoke_task'
/usr/local/rvm/gems/ruby-2.1.3/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/usr/local/rvm/gems/ruby-2.1.3/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/usr/local/rvm/gems/ruby-2.1.3/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/usr/local/rvm/gems/ruby-2.1.3/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/usr/local/rvm/gems/ruby-2.1.3/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/usr/local/rvm/gems/ruby-2.1.3/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/usr/local/rvm/gems/ruby-2.1.3/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/usr/local/rvm/gems/ruby-2.1.3/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/usr/local/rvm/gems/ruby-2.1.3/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.1.3/bin/rake:23:in `load'
/usr/local/rvm/gems/ruby-2.1.3/bin/rake:23:in `<main>'
/usr/local/rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `<main>'
答案 0 :(得分:1)
检查您的佣金任务是否具有以下格式:
namespace :your_namespace do
desc 'Description for rake task'
task generate_secret_token: :environment do
end
end
在运行rake任务时,以&#39; rake命名空间运行:generate_secret_token&#39;
答案 1 :(得分:1)
rake db:migrate
此命令用于运行数据库迁移。
rake task_name
此命令用于运行您编写了lib / tasks文件夹
的rake任务