当前位置:  开发笔记 > 后端 > 正文

rbenv:未安装版本"2.2.3"(由RBENV_VERSION环境变量设置)

如何解决《rbenv:未安装版本"2.2.3"(由RBENV_VERSION环境变量设置)》经验,为你挑选了3个好方法。

当我运行部署脚本时,我遇到了错误:

[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 deploy@xx.xx.xx.xx: Exception while executing as deploy@xx.xx.xx.xx: 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 deploy@xx.xx.xx.xx: 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 deploy@xx.xx.xx.xx: Exception while executing as deploy@xx.xx.xx.xx: bundle exit status: 1
bundle stdout: rbenv: version `2.2.3' is not installed (set by RBENV_VERSION environment variable)
bundle stderr: Nothing written

Capfile 具有 set :rbenv_ruby, '2.2.3'

服务器和本地我已安装 ruby 2.2.3p173

将值更改2.2.32.2.3p173for set :rbenv_ruby不起作用.



1> 小智..:

我解决了同样的问题设置:rbenv_path.你的应该是:
set :rbenv_path, '/home/your/.rbenv/'

这必须在里面deploy.rb.



2> Jerome..:

上面的回答对我不起作用.gem update --system,然后bundle install会导致fatal: No live threads left. Deadlock?错误.

bundle exec cap development deploy

如果 gem 'sshkit', '~> 1.7.1'加速,完成部署.

但是,可能出现的情况是sshkitgem可能会更新1.8.0或更高.在这种情况下,假设在deploy.rb中设置标准的Ubuntu服务器

set :rbenv_path, '$HOME/.rbenv'

将允许部署完成.



3> paul.belt..:

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

笔记

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)

推荐阅读
Life一切安好
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有