Problem upgrading Ruby version


I upgraded my Rails project Gemfile to use Ruby version 2.2.1

However when I try to do

cap production deploy

I get the error message:

ERROR rbenv: 2.2.1 is not installed or not found in $HOME/.rbenv/versions/2.2.1

Does anyone have experience with this issue? I’m not sure I have to upgrade Ruby manually on the production server, or if this is handled by capistrano-rails

Thanks for your help,


@acandael are you running cap on your production server? From the error message, it looks like the machine (or the particular account on the machine) doesn’t have that version of Ruby. If you can open a shell on the server, I would use rbenv versions to get the list of versions. Make sure you’re doing this as the same user that Capistrano uses to do deployments.

Hi Geoff,

I’m running capistrano on my local machine. I can run the app in development. Only when I run:

cap production deploy

I get the error:

ERROR rbenv: 2.2.1 is not installed or not found in $HOME/.rbenv/versions/2.2.1



When I run

rbenv install --list

on the server (Ubuntu Trusty 14.04 Trusty Tahr) the highes version of Ruby I see in the list is:


Does that mean I can’t install Ruby 2.2.1 on Ubuntu 14.04 ?

If you’re using ruby-build with rbenv, you’ll need to update your version listings by updating ruby-build with apt. I would be very surprised if apt doesn’t have newer versions. I’d try updating your package listings in apt and then upgrading rbenv and ruby-build.

yeah, after updating ruby-build, I can see 2.2.1 in the list. Thanks Geoff

ok, we’re making progress

I was able to install Ruby 2.2.1 on the server and set it as the global version with

rbenv global 2.2.1

If I run

cap production deploy

Everything seems to start out fine, but suddenly I get the error:

DEBUG [47dbc416] 	rbenv: bundle: command not found
DEBUG [47dbc416]
DEBUG [47dbc416] 	The `bundle' command exists in these Ruby versions:
DEBUG [47dbc416] 	  2.1.3

it seems like the bundle command only exists for the previous ruby version.

Anyone familiar with this error?

thanks for your help

It seems that Bundler must be installed for every version of Ruby. So installing Bundler with

gem install bundler

fixed the issue

After the install I could run successfully

cap production deploy

Thanks Geoff for your help.