2015-12-07 10 views
7

私は、デプロイスクリプトを実行すると、私はエラーを抱えている:rbenv:バージョン `2.2.3' がインストールされていません(RBENV_VERSION環境変数で設定)

[cb123fad] rbenv: version `2.2.3' is not installed (set by RBENV_VERSION environment variable) 
DEBUG [cb123fad] 
(Backtrace restricted to imported tasks) 
cap aborted! 
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: Exception while executing as [email protected]: bundle exit status: 1 
bundle stdout: rbenv: version `2.2.3' is not installed (set by RBENV_VERSION environment variable) 
bundle stderr: Nothing written 

SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: bundle exit status: 1 
bundle stdout: rbenv: version `2.2.3' is not installed (set by RBENV_VERSION environment variable) 
bundle stderr: Nothing written 

SSHKit::Command::Failed: bundle exit status: 1 
bundle stdout: rbenv: version `2.2.3' is not installed (set by RBENV_VERSION environment variable) 
bundle stderr: Nothing written 

Tasks: TOP => deploy:initial 
(See full trace by running task with --trace) 
The deploy has failed with an error: Exception while executing as [email protected]: Exception while executing as [email protected]: bundle exit status: 1 
bundle stdout: rbenv: version `2.2.3' is not installed (set by RBENV_VERSION environment variable) 
bundle stderr: Nothing written 

Capfileset :rbenv_ruby, '2.2.3'

サーバーを持っており、ローカルにインストール済みruby 2.2.3p173

2.2.3から2.2.3p173への値をset :rbenv_rubyに変更しても機能しませんでした。

答えて

21

私は同じ問題設定:rbenv_pathを解決しました。あなたは次のようになります。
set :rbenv_path, '/home/your/.rbenv/'

これはdeploy.rbの内部でなければなりません。

+1

こんにちは!残念ながら、 'Capfile'に' set:rbenv_path'を追加するだけではうまくいきませんでした。御時間ありがとうございます。 – Askar

+1

これはCapfileではなく、deploy.rbにある必要があります。 –

+0

ええ、私は 'deploy.rb'に移動したときに働いていました。 – Askar

4

上記の回答は私には役に立たなかった。 gem update --systemの場合、bundle installfatal: No live threads left. Deadlock?のエラーになります。gem 'sshkit', '~> 1.7.1'がspedifiedされている場合

bundle exec cap development deploy 

は、展開を完了します。

しかし、sshkit gemが1.8.0以上に更新される可能性があります。その場合には、展開が完了することができますdeploy.rb

set :rbenv_path, '$HOME/.rbenv' 

で、標準のUbuntuサーバのセットアップを想定しました。

3

https://github.com/capistrano/sshkit/issues/303https://github.com/capistrano/rbenv/pull/59

NOTES

set :rbenv_path, '/home/your/.rbenv/' # works 
set :rbenv_path, '~your/.rbenv/' # doesn't work 

この問題が原因sshkitの変化に作成されます。

diff --git a/Gemfile.lock b/Gemfile.lock 
index b85dabe..a909ee0 100644 
--- a/Gemfile.lock 
+++ b/Gemfile.lock 
@@ -57,6 +57,7 @@ GEM 
    code_metrics (0.1.3) 
    coderay (1.1.0) 
    colored (1.2) 
+ colorize (0.7.7) 
    concord (0.1.5) 
     adamantium (~> 0.2.0) 
     equalizer (~> 0.0.9) 
@@ -215,7 +216,8 @@ GEM 
    slop (3.6.0) 
    spoon (0.0.4) 
     ffi 
- sshkit (1.8.1) 
+ sshkit (1.7.1) 
+  colorize (>= 0.7.0) 
     net-scp (>= 1.1.2) 
     net-ssh (>= 2.8.0) 
    terminal-table (1.5.2) 
関連する問題