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.
Does rbenv look on my local machine or on the DO droplet for the ruby version?? Or both for that matter...
The output on DO for which ruby
is `/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]
...so it looks like I have ruby installed correctly but it just isn't recognising it??
In my Capfile I have
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.
This SO question suggests that ruby should be installed on the root user. In my case I have installed it as user 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
.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With