我在使用Capistrano进行部署时尝试执行rake
,但我发现要执行问题,因为ZSH
。
zsh:1: command not found: rake
所以我从我的机器上删除了ZSH
,但同样的问题仍然存在。
config/deploy.rb
desc 'My task'
task :my_task do
on roles(:app) do
execute 'rake my:task'
end
end
日志:
00:00 deploy:my_task
01 rake my:task
01 zsh:1: command not found: rake
01
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host example.com: rake my:task exit status: 127
rake my:task stdout: zsh:1: command not found: rake
rake my:task stderr: Nothing written
/Users/monteirobrena/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/gems/2.0.0/gems/sshkit-1.10.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute'
/Users/monteirobrena/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/gems/2.0.0/gems/sshkit-1.10.0/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
SSHKit::Command::Failed: rake my:task exit status: 127
rake my:task stdout: zsh:1: command not found: rake
rake my:task stderr: Nothing written
/Users/monteirobrena/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/gems/2.0.0/gems/sshkit-1.10.0/lib/sshkit/command.rb:100:in `exit_status='
/Users/monteirobrena/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/gems/2.0.0/gems/sshkit-1.10.0/lib/sshkit/backends/netssh.rb:136:in `execute_command'
/Users/monteirobrena/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/gems/2.0.0/gems/sshkit-1.10.0/lib/sshkit/backends/abstract.rb:137:in `block in create_command_and_execute'
/Users/monteirobrena/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/gems/2.0.0/gems/sshkit-1.10.0/lib/sshkit/backends/abstract.rb:137:in `tap'
/Users/monteirobrena/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/gems/2.0.0/gems/sshkit-1.10.0/lib/sshkit/backends/abstract.rb:137:in `create_command_and_execute'
/Users/monteirobrena/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/gems/2.0.0/gems/sshkit-1.10.0/lib/sshkit/backends/abstract.rb:69:in `execute'
config/deploy.rb:92:in `block (3 levels) in <top (required)>'
/Users/monteirobrena/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/gems/2.0.0/gems/sshkit-1.10.0/lib/sshkit/backends/abstract.rb:29:in `instance_exec'
/Users/monteirobrena/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/gems/2.0.0/gems/sshkit-1.10.0/lib/sshkit/backends/abstract.rb:29:in `run'
/Users/monteirobrena/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/gems/2.0.0/gems/sshkit-1.10.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => deploy:upload_assets
答案 0 :(得分:0)
这与zsh无关;相反,它似乎只能在环境的路径中找到耙子。三个选项: