1

I recently upgraded from Ruby 1.9.3 to version 2.0.0. To do so, I used the following command:

$ rvm install ruby-2.0.0
$ rvm --default use ruby-2.0.0

It successfully installed and set as default ruby-2.0.0; however, when I enter ruby -v I encounter the error:

Rails is not currently installed on this system. To get the latest version, simply type:

    $ sudo gem install rails

You can then rerun your "rails" command.

I know Rails is installed and, before upgrading my version of Ruby, I ran rails -v which returned my current version.

Attempts to Troubleshoot

I followed the solution found on an earlier post and ran the following commands:

gemsets for ruby-1.9.3-p374 (found in /Users/.../.rvm/gems/ruby-1.9.3-p374)
   (default)
=> global
   rails3tutorial2ndEd

/etc/rvmrc: line 5: install:: command not found
/etc/rvmrc: line 6: update:: command not found

gemsets for ruby-2.0.0-rc1 (found in /Users/.../.rvm/gems/ruby-2.0.0-rc1)
   (default)
=> global

rvm use ruby-2.0.0-rc1@global

However, running rails -v again shows that the issue still persists.

Any help would be greatly appreciated!

Update:

Impatience led me to just re-install Rails which fixed the problem. However, I'm still curious if there was a better way of troubleshooting this without (likely unnecessarily) re-installing Rails.

Community
  • 1
  • 1
Thai Nguyen
  • 55
  • 1
  • 7

1 Answers1

2

Gemsets in RVM are isolated in that they are only available to a single version of Ruby. As such, you need to re-install the Rails gem after installing a new version of Ruby.

When a version of Ruby is installed via RVM, 2 associated gemsets will be created simultaneously. One is called "global" and one is called "default".

Ruby versions (and their single associated global gemset) are made active via the rvm use ruby_version_here command.

The default or (potentially multiple) user generated gemsets are made active via the rvm use gemset_name_here command.

Whether a gemset is a global, default, or user generated - it is only available to a single version of Ruby.

Here's a nice blog post covering the topic in a bit more detail.

mxs
  • 615
  • 6
  • 17