Skip to main content

rbenv: 2.1.2 is not installed or not found

Servers • Asked by Peter Boomsma

I'm trying to deploy my local Rails app to my Digital Ocean VPS using the GoRails guide > https://gorails.com/deploy/ubuntu/14.04

But I'm running into a error when I want to deploy:

cap production deploy

Results in

[email protected]:~/sites/movieseat$ cap production deploy
DEBUG[790313df] Running /usr/bin/env [ -d ~/.rbenv/versions/2.1.2 ] on 178.62.204.53
DEBUG[790313df] Command: [ -d ~/.rbenv/versions/2.1.2 ]
DEBUG[790313df] Finished in 0.380 seconds with exit status 1 (failed).
ERRORrbenv: 2.1.2 is not installed or not found in ~/.rbenv/versions/2.1.2
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host 178.62.204.53: exit

SystemExit: exit

Tasks: TOP => rbenv:validate

I've found this topic > https://gorails.com/forum/ruby-issue-when-doing-cap-deploy-production which has the same issue, but the fix they use

set :rbenv_ruby, '2.1.2'

Doesn't work, because I allready state the following in my Capfile

require 'capistrano/rbenv'
set :rbenv_type, :user # or :system, depends on your rbenv setup
set :rbenv_ruby, '2.1.2'

Can someone point out what the problem is?

Update

When I run:

which ruby

I get:

/home/alucardu/.rbenv/shims/ruby

When I check my files I can go to /home/alucardu/.rbenv/versions/2.1.2, so it should all be there.

Update

Looks like I was installing rbenv on my local server instead of my VPS. Doing that now.

Update

Yup, quite stupid of me. Pretty much done now!


Haha, that would do it! I imagine that there are a few places where I could clean up the tutorial to show you on which machine to run which commands.


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.