我有一个自定义rake任务来评估Rails最佳实践和Brakeman的项目如下:
namespace :evaluate do
desc 'Evaluate project for best practices!'
task :best_practices do
path = File.expand_path("../../../", __FILE__)
sh "rails_best_practices #{path}"
end
desc 'Evaluate project with brakeman'
task :brakeman do
sh "brakeman -q -z"
end
desc 'Evaluate everything'
task :everything => [:brakeman, :best_practices]
end
$ rake评估:任务完成Brakeman的所有操作,但在rails_best_practices步骤中以下列跟踪中止:
Command failed with status (14): [rails_best_practices /Users/admin/projects...]
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/file_utils.rb:54:in `block in create_shell_runner'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/file_utils.rb:45:in `call'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/file_utils.rb:45:in `sh'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/file_utils_ext.rb:37:in `sh'
/Users/admin/projects/bubblin/lib/tasks/security.rake:5:in `block (2 levels) in <top (required)>'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/admin/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/task.rb:201:in `block in invoke_prerequisites'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/task.rb:199:in `each'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/task.rb:199:in `invoke_prerequisites'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/task.rb:178:in `block in invoke_with_call_chain'
/Users/admin/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/application.rb:150:in `invoke_task'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/application.rb:106:in `each'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/Users/admin/.rvm/gems/ruby-2.1.1/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/Users/admin/.rvm/gems/ruby-2.1.1/bin/rake:23:in `load'
/Users/admin/.rvm/gems/ruby-2.1.1/bin/rake:23:in `<main>'
/Users/admin/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/Users/admin/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
我觉得这与我的Gemfile有关,但无法查明问题。什么可能导致create_shell_runner&#39;中的&#39;块这个rake任务有问题吗?
提前致谢!