I’m on Linux Ubuntu 12.04, and I first installed Ruby 1.9.2.
After I tried installing rvm to use Octopress, ruby --version in bash results in ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
How can I use RVM with ruby 1.9.2?
I don’t really understand what RVM is all about…
RVM is a version manager which enables you to decide which of multiple installed Ruby versions you want to use in your current shell session. RVM does this by providing a shell function named
rvmwhich can be used to switch between versions in the current session. This changes environment variables, especially the GEM_HOME and PATH, to match the currently selected Ruby installation.Every installed Ruby version can be selected by a specific identifier string. If you had a system-wide Ruby installation already before you installed RVM, that one should be referenced by the string
system. The newly installed version in your case should be called1.9.2.To make RVM work as intended, it is necessary to load the
rvmshell function into your shell. How to do this is described in the RVM Installation Documentation in section 2 – “Load RVM into your shell sessions as a function”.You can see if the shell function is correctly loaded when the command
type rvm | head -n1responds with:If not correctly loaded it will tell you something like this:
If you finally have it working you can switch your active Ruby version with commands like
rvm 1.9.2orrvm system. You can get a list of all Ruby versions and their identifier strings recognized by RVM by the commandrvm list.You can also specify which Ruby version shall be enabled in all new shell sessions from the beginning by issuing the following command once: