Wednesday, 18 April 2012

Ruby On Gentoo with RVM

is my favoured but sometimes it takes time to learn to love its quirks. Last week, I found a tweak is needed to develop on using and . Here's how...

With a shiny new user and a shiny new .rvmrc after cd (into the directory) I see

==============================================================================
= NOTICE                                                                     
==============================================================================
= RVM has encountered a new or modified .rvmrc file in the current directory =
= This is a shell script and therefore may contain any shell commands.       =
=                                                                            =
= Examine the contents of this file carefully to be sure the contents are    =
= safe before trusting it! ( Choose v[iew] below to view the contents )      =
==============================================================================
Do you wish to trust this .rvmrc file? (/home/hedtek/space/.rvmrc)
y[es], n[o], v[iew], c[ancel]> y 

Trying to install bundler then fails with

$ gem install bundler
/home/hedtek/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/
  site_ruby/1.9.1/rubygems/custom_require.rb:36:
  in `require': cannot load such file -- auto_gem (LoadError)
 from /home/hedtek/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/
  site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'

Turns out that the Gentoo defaults don't play well with rails development. Easy to fix by an unset when starting a development session:

$ unset RUBYOPT

Once this has been done, all is good:

$ gem install bundler
Fetching: bundler-1.1.3.gem (100%)
Successfully installed bundler-1.1.3
1 gem installed
Installing ri documentation for bundler-1.1.3...
unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT 
to UTF-8 to US-ASCII for lib/bundler/vendor/thor/invocation.rb, skipping
Installing RDoc documentation for bundler-1.1.3...
unable to convert "\xC3" to UTF-8 in conversion 
from ASCII-8BIT to UTF-8 to US-ASCII 
for lib/bundler/vendor/thor/invocation.rb, skipping

Thanks to this post for setting me on the right road...

4 comments:

  1. Argh.

    Thanks man.

    Gentoo is ill-behaved on this one, I think.

    But big thanks.
    -rking

    ReplyDelete
  2. Wanna send you a big thank for your share! It's really helpful! Thanks so much! :)

    ReplyDelete
  3. Thank you man.

    In fact, I was just fine with the system rubies and eselect, but as soon as I install a custom ruby version locally, I got the same problem, and unsetting RUBYOPT makes the pain go away.

    ReplyDelete