Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I associate a new rvm install with existing ruby versions?

Tags:

ruby

rvm

I was having a problem with RVM, so I uninstalled and re-installed it.

The truth is I actually tried rbenv, but that didn't work out for me so I am trying to get rvm up and running again - without having to install duplicate versions of Ruby.

I have at least 1 existing version of Ruby installed:

ruby --version
ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0]

But when I do rvm list I get a blank list:

bash-3.2$ rvm list

rvm rubies


# Default ruby not set. Try 'rvm alias create default <ruby>'.

# => - current
# =* - current && default
#  * - default

So my question has two parts:

  • How do I see all the versions of Ruby on my system (given that rvm is not showing me any)?
  • How do I associate the new RVM install with the existing versions of Ruby?

Or am I better off removing all existing versions of Ruby and re-installing everything? That seems like a pain in the ass though.

like image 850
marcamillion Avatar asked Aug 29 '12 00:08

marcamillion


1 Answers

You can add an existing ruby to rvm using:

rvm mount /path/to/ruby 

or:

rvm automount

but be careful as ruby installed in system might have hardcoded paths for gems - so gemsets would not work with it.

There is also new way of adding binary rubies (already compiled), for list of available builds for your platform run:

rvm list remote

and you can install those rubies using:

rvm mount -r 1.9.3

This might be default way of installing ruby to avoid compilation in next stable release of RVM - but it will work only for ruby 1.9.3+.

like image 94
mpapis Avatar answered Oct 11 '22 14:10

mpapis