Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

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.

like image 822
Jay Killeen Avatar asked Jan 09 '17 01:01

Jay Killeen


1 Answers

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.

like image 55
Jay Killeen Avatar answered Sep 28 '22 07:09

Jay Killeen