[英]Rails + Capistrano `rbenv: 2.3.1 is not installed or not found in $HOME/.rbenv/versions/2.3.1`
I'm getting an rbenv: 2.3.1 is not installed or not found in $HOME/.rbenv/versions/2.3.1
when trying to deploy to Digital Ocean with Capistrano. 我得到一个
rbenv: 2.3.1 is not installed or not found in $HOME/.rbenv/versions/2.3.1
在尝试使用Capistrano部署到Digital Ocean时, rbenv: 2.3.1 is not installed or not found in $HOME/.rbenv/versions/2.3.1
。
Does rbenv look on my local machine or on the DO droplet for the ruby version?? rbenv是否可以在我的本地机器或DO Droplet上查找ruby版本? Or both for that matter...
或者两者兼而有之......
The output on DO for which ruby
is `/home/deploy/.rbenv/shims/ruby DO上的输出
which ruby
是`/home/deploy/.rbenv/shims/ruby
The output on DO for ruby -v
is ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
DO-
ruby -v
的输出是ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
...so it looks like I have ruby installed correctly but it just isn't recognising it?? ...所以看起来我正确安装了红宝石,但它只是没有认识到它?
In my Capfile I have 在我的Capfile中我有
require 'capistrano/rbenv' set :rbenv_type, :user # or :system, depends on your rbenv setup set :rbenv_ruby, '2.3.1'
I'm following the guide on GoRails . 我正在关注GoRails的指南。
This SO question suggests that ruby should be installed on the root user. 这个问题表明应该在root用户上安装ruby。 In my case I have installed it as user
deploy
. 在我的情况下,我已将其安装为用户
deploy
。
As per the post I linked to. 根据我链接的帖子。 I thought I was changing the path correctly to point to the deploy home directory but I was using
$HOME
instead of /home
. 我以为我正在正确地更改路径以指向部署主目录,但我使用
$HOME
而不是/home
。
deploy.rb was updated to set :rbenv_path, '/home/deploy/.rbenv'
instead of set :rbenv_path, '$HOME/deploy/.rbenv'
and it is now working correctly. deploy.rb已更新为
set :rbenv_path, '/home/deploy/.rbenv'
set :rbenv_path, '$HOME/deploy/.rbenv'
而不是set :rbenv_path, '$HOME/deploy/.rbenv'
,它现在正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.