帽流产! rbenv:捆绑:找不到命令

问题描述

部署时,我收到此错误

> cap production deploy

{...}
DEBUG[d1dd96ac]     rbenv: bundle: command not found
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host 185.162.92.85: bundle exit status: 127
bundle stdout: nothing written
bundle stderr: rbenv: bundle: command not found
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/command.rb:97:in `exit_status='
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:148:in `block (5 levels) in _execute'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:551:in `call'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:551:in `do_request'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:561:in `channel_request'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:in `preprocess'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in `process'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `block in loop'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:269:in `wait'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:170:in `block (3 levels) in _execute'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:514:in `call'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:514:in `do_open_confirmation'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:545:in `channel_open_confirmation'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:in `preprocess'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in `process'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `block in loop'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:172:in `block (2 levels) in _execute'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:186:in `with_ssh'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:131:in `block in _execute'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `tap'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `_execute'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:66:in `execute'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/capistrano-bundler-1.1.3/lib/capistrano/tasks/bundler.cap:35:in `block (5 levels) in <top (required)>'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/abstract.rb:85:in `with'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/capistrano-bundler-1.1.3/lib/capistrano/tasks/bundler.cap:26:in `block (4 levels) in <top (required)>'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/abstract.rb:77:in `within'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/capistrano-bundler-1.1.3/lib/capistrano/tasks/bundler.cap:25:in `block (3 levels) in <top (required)>'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `run'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
SSHKit::Command::Failed: bundle exit status: 127
bundle stdout: nothing written
bundle stderr: rbenv: bundle: command not found
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/command.rb:97:in `exit_status='
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:148:in `block (5 levels) in _execute'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:551:in `call'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:551:in `do_request'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:561:in `channel_request'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:in `preprocess'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in `process'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `block in loop'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:269:in `wait'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:170:in `block (3 levels) in _execute'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:514:in `call'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:514:in `do_open_confirmation'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:545:in `channel_open_confirmation'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:221:in `preprocess'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in `process'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `block in loop'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:172:in `block (2 levels) in _execute'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:186:in `with_ssh'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:131:in `block in _execute'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `tap'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:128:in `_execute'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:66:in `execute'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/capistrano-bundler-1.1.3/lib/capistrano/tasks/bundler.cap:35:in `block (5 levels) in <top (required)>'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/abstract.rb:85:in `with'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/capistrano-bundler-1.1.3/lib/capistrano/tasks/bundler.cap:26:in `block (4 levels) in <top (required)>'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/abstract.rb:77:in `within'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/capistrano-bundler-1.1.3/lib/capistrano/tasks/bundler.cap:25:in `block (3 levels) in <top (required)>'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `run'
/home/deployer/.rvm/gems/ruby-2.2.10/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has Failed with an error: #<SSHKit::Runner::ExecuteError: Exception while executing on host xxx.xxx.xx.xx: bundle exit status: 127
bundle stdout: nothing written
bundle stderr: rbenv: bundle: command not found

我该如何解决? 我的 Capfile 和其他信息:

*Capfile*
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rbenv'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'whenever/capistrano'
require 'capistrano/sidekiq'
require 'capistrano/slackify'
set :rbenv_ruby,'2.2.10'
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

> ruby -v
ruby 2.2.10p489 (2018-03-28 revision 63023) [x86_64-linux]

> bundler -v
Bundler version 1.17.3

> which ruby
/home/deployer/.rvm/rubies/ruby-2.2.10/bin/ruby

> which bundle
/home/deployer/.rvm/gems/ruby-2.2.10/bin/bundle

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)