Ruby 1.9.2 and RVM

RVM is no doubt an amazing piece of code. It just makes life so much easier. Ruby 1.9.2 is out. Woo-hoo! and I tried installing it with rvm only to encounter an error. I fixed the error and this post outlines my shenanigans leading to an easy solution.

Mark has done a nice post on rvm with ruby 1.9.2 and rails3. I used it as my starting point and ran the following command in the Terminal.

rvm install 1.9.2 -C --with-readline-dir=/opt/local,--build=x86_64-apple-darwin10

It downloads the ruby 1.9.2 and errors whilst running make. Here’s the rvm error message:

info: Installing Ruby from source to: /Users/andhapp/.rvm/rubies/ruby-1.9.2-p0

info: /Users/andhapp/.rvm/src/ruby-1.9.2-p0 has already been extracted.

info: Configuring ruby-1.9.2-p0, this may take a while depending on your cpu(s)...

info: Compiling ruby-1.9.2-p0, this may take a while depending on your cpu(s)...

error: Error running 'make ', please check /Users/andhapp/.rvm/log/ruby-1.9.2-p0/make*.log

error: There has been an error while running make. Aborting the installation.

This points at a make error log. Further investigation of the make.error.log file revealed the following error message (only the last 10 lines):

_sdbm.c: In function ‘chkpage’:
_sdbm.c:864: warning: comparison between signed and unsigned
raddrinfo.c: In function ‘nogvl_getaddrinfo’:
raddrinfo.c:140: warning: passing argument 3 of ‘ruby_getaddrinfo__darwin’ discards qualifiers from pointer target type
bytecode.re: In function ‘sycklex_bytecode_utf8’:
bytecode.re:442: warning: implicit conversion shortens 64-bit value into a 32-bit value
rubyext.c: In function ‘mktime_do’:
rubyext.c:278: warning: comparison between signed and unsigned
/Library/Ruby/Gems/1.8/gems/rdoc-2.4.3/lib/rdoc/rdoc.rb:51: warning: already initialized constant GENERATORS
[BUG] cross-thread violation on rb_gc()
ruby 1.8.6 (2009-06-08) [universal-darwin9.0]

make: *** [rdoc] Abort trap

There’s a very strange thing in this error message. For some reason, it is referencing ruby 1.8.6. But, why? Well, I am not sure what causes it but here’s how I fixed it. My default system ruby is version 1.8.6 and that was the current ruby in the context when I ran the rvm command. I used rvm to change the current ruby to 1.9.2-preview1 and then re-ran the command. Volia! It worked.

No idea what causes it but worth investigating!

About andhapp

Namastey (Hello) Stranger, This is not the geekiest blog on the planet yet it is not the dumbest one either. I am a small time developer who likes to explore new technologies. I usually program in Java, Groovy and Ruby and take keen interest in the surrounding geeky developments.
This entry was posted in Programming and tagged , , . Bookmark the permalink.

2 Responses to Ruby 1.9.2 and RVM

  1. Mark Turner says:

    Interesting issue! What version of OS X are you running?

  2. andhapp says:

    Hey Mark, 

    I am still running Leopard 10.5.8. 
    Anuj
    @andhapp

Leave a Reply

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> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>