How to upgrade Ruby



Hello, first of all I want to say that I’m grateful for this platform, which I think is really awesome.

I’m deploying to Heroku but my app get’s this error in the log:

I checked the requirements for Ruby on Heroku, and it says 2.2.4, but when I check on my app in cloud9 it’s: 2.2.1p85
I think this might be the problem but I don’t know how or if I can update Ruby on my workspace in cloud9.


Ruby 1.9.3 DEPRECATION WARNING - how do I update?
Writing a Ruby App

You can update Ruby using Ruby Version Manager, or RVM. In your case you want to upgrade to 2.2.4.

To use rvm, open the terminal and type:

rvm use 2.2

At this point, you may be prompted to install 2.2.1 by running rvm install ruby-2.2.1 so go ahead and do that. Once that is installed, continue as follows.

rvm use 2.2
rvm use 2.2.4

And then you should be all set :muscle:


Thank you! I’m going to test it out!


Just finished at last a successful deployment, after changing the Ruby version with rvm, I still got errors within Heroku, but downgrading the versions of some gems to 4.2.2 did it!


If you are getting Ruby version errors when deploying to Heroku, add a Ruby version statement to your Gemfile. Something like this:

ruby '2.2.1' or any other version.

I believe that should work.


Yes, that does work. The problem is, however, that in Heroku there are problems with versions of some gems, like reaities 4.2.5, had to downgrade them.


I’ve just finished doing a similar move of a project from 2.3.0 to 2.3.1.

In addition to:

  • installing 2.3.1 under rvm, and
  • adding a line in my Gemfile: ruby '2.3.1'

I found that for the “Run Project” button to pick up the correct version of ruby, I had to:

  • set the default ruby for rvm, using:
    rvm --default use 2.3.1
    and then

  • choose “Restart Workspace” from the Cloud9 menu.

I did not do this:

rvm upgrade 2.3.0 2.3.1

I didn’t do this as I wanted to install 2.3.1 experimentally and have a quick way back, but on reflection, I should have. Doing an upgrade like this would remove the need to set a default (because it’d be the only available ruby).


I did a rvm install 2.3.1 … which thus far has made me bundle update & install all of my gems again :frowning:

Is there a way to dodge that on an existing project?