当我运行部署脚本时,出现错误:
[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
为 set :rbenv_ruby
将值从 2.2.3
更改为 2.2.3p173
无效。
最佳答案
我通过设置 :rbenv_path
解决了同样的问题。你的应该是:
set :rbenv_path, '/home/your/.rbenv/'
这必须在 deploy.rb
中。
关于ruby - rbenv:未安装版本 `2.2.3'(由 RBENV_VERSION 环境变量设置),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34126546/