Nepal on Rails

millisami's rants!

Rvm Install Ruby Woes!!

Sometime when upgrading RVM or just doing a fresh install and try to install Rubies, one might stumble upon a weird problem. I’ve also encountered such situations several times. Specially, when RVM brings breaking changes while updating. The following is the most recurring issue I’ve faced with. So, just documenting for this time so that I don’t have to Google it again.

rvm install ree
ruby-1.8.7-p330 - #fetching
ruby-1.8.7-p330 - #extracting ruby-1.8.7-p330 to /Users/andrew/.rvm/src/ruby-1.8.7-p330
ruby-1.8.7-p330 - #extracted to /Users/andrew/.rvm/src/ruby-1.8.7-p330
ruby-1.8.7-p330 - #configuring
ruby-1.8.7-p330 - #compiling
Error running make , please read /Users/andrew/.rvm/log/ruby-1.8.7-p330/make.log
There has been an error while running make. Halting the installation.

If you do it again, you’ll see the error

Installing Ruby Enterprise Edition from source to: /Users/millisami/.rvm/rubies/ree-1.8.7-2011.03
It appears that the archive has already been extracted. Skipping extract (use --force to force re-download and extract).
ree-1.8.7-2011.03 - #installing
ERROR: Error running ./installer -a /Users/millisami/.rvm/rubies/ree-1.8.7-2011.03  --no-tcmalloc --dont-install-useful-gems -c --with-readline-dir=/usr/local/Cellar/readline/6.2.1, please read /Users/millisami/.rvm/log/ree-1.8.7-2011.03/install.log
ERROR: There has been an error while trying to run the ree installer. Halting the installation.

When you see the log file, you’ll see something at the end of that file:

readline.c: In function ‘username_completion_proc_call’

This error is due to the readline library.

Now you’ve got 2 options. One is to install readline via rvm pkg install readline or if you have homebrew installed, you can install it via brew update; brew install readline.

Then, brew info readline will show the readline path.

So now, you opt for either way.

# if you go via homebrew way
$ rvm remove ree
$ rvm install ree -C --with-readline-dir=/usr/local/Cellar/readline/6.2.1

# if with rvm way
$ rvm get head; rvm reload
$ rvm pkg install readline
$ rvm remove ree
$ rvm install ree --with-readline-dir=$rvm_path/usr