我正在使用bower,现在需要在我的服务器上部署它。 这些是我的capistrano deploy.rb的相关部分:
lock '3.4.0'
set :application, 'braint'
set :rvm_ruby_version, '2.2.3@braint'
set :nvm_map_bins, %w{npm node bower}
set :nvm_node, 'v6.0.0'
set :bower_target_path, "#{release_path}"
这就是部署失败的方式:
DEBUG [684affc8] Finished in 0.035 seconds with exit status 0 (successful).
INFO [e5982f6c] Running /usr/bin/env /usr/local/bin/bower install --quiet --config.interactive=false on xxx.xxx.xxx.xxx
DEBUG [e5982f6c] Command: cd /home/deployer/apps/braint/current && ( export NODE_VERSION="v6.0.0" ; /usr/bin/env /usr/local/bin/bower install --quiet --config.interactive=false )
DEBUG [e5982f6c] /usr/bin/env: node
DEBUG [e5982f6c] : No such file or directory
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host xxx.xxx.xxx.xxx: /usr/local/bin/bower exit status: 127
/usr/local/bin/bower stdout: Nothing written
/usr/local/bin/bower stderr: /usr/bin/env: node: No such file or directory
SSHKit::Command::Failed: /usr/local/bin/bower exit status: 127
/usr/local/bin/bower stdout: Nothing written
/usr/local/bin/bower stderr: /usr/bin/env: node: No such file or directory
Tasks: TOP => deploy:updated => bower:install
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing on host xxx.xxx.xxx.xxx: /usr/local/bin/bower exit status: 127
/usr/local/bin/bower stdout: Nothing written
/usr/local/bin/bower stderr: /usr/bin/env: node: No such file or directory
如果我在交互式SSH会话上剪切并粘贴相同的命令,它不会返回任何错误,这非常奇怪...
它是不是因为它是非交互式shell而没有加载nvm?我该如何解决这个问题?