Ask A Question

Notifications

You’re not receiving notifications from this thread.

rbenv: 2.1.2 is not installed or not found

Peter Boomsma asked in Servers

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

alucardu@alucardu-VirtualBox:~/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!

Reply

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.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,946+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.