RVM install ruby-1.8.7-p330 fails

Today I’m thinking of getting back into so good old work and I read there is a new patch to Ruby, version p330. So I figure that RVM (Ruby Version Manager) being so easy and quick to update, I’d do the good old “rvm get head, rvm reload, rvm update 1.8.7″ and I’m off to the races.

Well it wasn’t quite as simple. I ended up with an error:
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.

When I looked into the the make.log, It had this to say:
readline.c: In function ‘username_completion_proc_call’:
readline.c:730: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:730: error: (Each undeclared identifier is reported only once
readline.c:730: error: for each function it appears in.)

So, I figured this was going to take too long to deal with, and moved on to working on my projects. That is till I opened up my project and and did a “rvm 1.8.7@rails3″ and it come up with:
warn: ruby ruby-1.8.7-p330 is not installed.
To install do: 'rvm install ruby-1.8.7-p330'

Great! Now I can’t upgrade, and I can’t work with what I have!

Long story short, I figured out that I was missing readline (now I’m sure I’ve installed in a long while ago, but I think I was missing the latest version). Also, rvm install readline resulted in an “Unrecognized command line argument: ‘readline’ ( see: ‘rvm usage’ )

Turns out RVM updated it’s command to install readline to:
rvm package install readline

Update: (Nov 10, 2011)
If you’re using a newer version of RVM, package has been renamed to pkg, so the command to install readline would be:
rvm pkg install readline

However this didn’t fix my install issue, still got the same error. Luckily I found a post that pointed out that my rvm may not know where readline is (odd, as I used rvm to install readline). Running this command allowed me to install it correctly:
rvm install 1.8.7 -C –with-readline-dir=/Users/andrew/.rvm/usr
[Notice: 'andrew' is my username on my mac, yours might be different]

rvm install 1.8.7 -C --with-readline-dir=$rvm_path/usr

Like always, I’m hoping this helps some people out.

Let me know if you have any issues.

10 Comments

  1. Just a quick note – you could have gotten your original 1.8.7 install working simply by including the patch-level (which was probably p174) so:

    rvm 1.8.7-p174@rails3

    If you use .rvmrc project files, I’d suggest you always include the patch level so that when the default patch level is upped in RVM then your projects don’t suddenly stop working :)

  2. That’s a great point David.
    However when I got the error, I took it on as a challenge :)
    But I’m updating my .rvmrc files now…

  3. Ah, the joy of a challenge :)

    As another improvement for the future then, you can use the $rvm_path environment variable instead of remembering where RVM is installed. That would make your install flag into:
    –with-readline-dir=$rvm_path/usr

    which is a bit easier to type and remember ;)

  4. Thanks David, I’ve updated the post to reflect the easier install script.

  5. Christian Sage

    A very minor point: the command should read

    rvm install 1.8.7 -C –with-readline-dir=$rvm_path/usr

    with a capital C in -C. Readers would probably appreciate if cut and pasted worked again as expected. ;-)

  6. Thank you Christian, I’ve updated the post to reflect the change.

  7. Thanks a lot for the info Christian! I use homebrew, so instead of using rvm to install readline and pointing to that, I used –with-readline-dir=/usr/local to point to my brew-installed readline.

  8. chris Zingel

    Many thanks. It worked great

  9. Thanks Andrew. This helped.

  10. Olivier Henkinbrant

    Great post ! Thank you so much Andrew :D

Trackbacks/Pingbacks

  1. Error running make when installing Ruby 1.8.7-p302 via RVM on Mac OS 10.5.8 - [...] Fuente stackoverflow Fuente RVM install ruby-1.8.7-p330 fails [...]

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">