2016-12-06 7 views
0

をシェルすることはできません使用やリモートサーバーrbenvルビー: Capistrano Version: 3.6.1 (Rake Version: 11.3.0)カピストラーノ3は、リモートサーバー上rbenvのルビーにアクセスしたりするためにカピストラーノ3を取得できません

/Users/victorstan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute' 
/Users/victorstan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute' 
SSHKit::Command::Failed: which ruby exit status: 1 
which ruby stdout: which: no ruby in (/usr/local/bin:/bin:/usr/bin:/opt/dell/srvadmin/bin) 
which ruby stderr: Nothing written 
/Users/victorstan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/command.rb:100:in `exit_status=' 
/Users/victorstan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/netssh.rb:148:in `execute_command' 
/Users/victorstan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:141:in `block in create_command_and_execute' 
/Users/victorstan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:141:in `tap' 
/Users/victorstan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:141:in `create_command_and_execute' 
/Users/victorstan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:60:in `capture' 
config/deploy.rb:88:in `block (4 levels) in <top (required)>' 
/Users/victorstan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:85:in `within' 
config/deploy.rb:82:in `block (3 levels) in <top (required)>' 
/Users/victorstan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:29:in `instance_exec' 
/Users/victorstan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:29:in `run' 
/Users/victorstan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute' 

マイセットアップ:

deploy.rb

set :rbenv_type, :user 
set :rbenv_ruby, '1.9.3-p551' # same as in .ruby-version file 
set :default_shell, '/bin/bash -l' 
set :pty, true 

within release_path do 
    ruby_v = capture("which ruby") 
    puts "Ruby version: #{ruby_v}" 
end 

Capfile

# Load DSL and set up stages 
require "capistrano/setup" 

# Include default deployment tasks 
require "capistrano/deploy" 

# Extra rails commands 
require "capistrano/rails/collection" 

# Include tasks from other gems included in your Gemfile 
# 
# For documentation on these, see for example: 
# 
# https://github.com/capistrano/rvm 
# https://github.com/capistrano/rbenv 
# https://github.com/capistrano/chruby 
# https://github.com/capistrano/bundler 
# https://github.com/capistrano/rails 
# https://github.com/capistrano/passenger 
# 
# require 'capistrano/rvm' 
require 'capistrano/rbenv' 
# require 'capistrano/chruby' 
require 'capistrano/bundler' 
require 'capistrano/rails/assets' 
require 'capistrano/rails/migrations' 
# require 'capistrano/passenger' 

# Load custom tasks from `lib/capistrano/tasks` if you have any defined 
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r } 

config/deploy/staging.rb

set :ssh_options, { 
    forward_agent: true, 
    auth_methods: %w(password), 
    password: 'xxx', 
    user: 'xxx', 
} 
+0

あなたが 'ssh_options'を持っている可能性があるのでしょうか?capistrano-rbenv source - > https://github.com/capistrano/rbenv/blob/master/lib/capistrano/tasks/rbenv.rakeを確認してください。 – faron

+0

btwどの宝石のバージョンを使用していますか? – faron

+0

@faronその場合、変更する唯一のものは私がログインするように求められていることです。上記の問題の他に、さらにメッセージが表示されます。「テキストはクリアにエコーされます。エコーテキストを抑制するためにHighLineまたはTermiosライブラリをインストールしてください。 –

答えて

0

カピストラーノと非対話型シェルで、rbenv構成は、他のbashのプロファイルファイルの代わりに.bashrcに入れなければならないことと思われます。

は、私の場合は、.bashrc

export PATH="$HOME/.rbenv/bin:$PATH" 
export TMPDIR="$HOME/tmp" 
eval "$(rbenv init -)" 

を移動し、それが私の問題を解決しました。

関連する問題