art's abode

OpenSolaris, Netbeans and rubygems.

without comments

If you are stuck trying to get rubygems installed in your OpenSolaris environment, the following may help. I ran into these issues while installing bcrypt-ruby and sqlite3-ruby gems.

  • First off, get the SUNWruby18 package, not the netbeans or jruby one. You can setup netbeans to use the  SUNWruby18 binary rather than jruby.
  • Install GCC, for example package name gcc-432.
  • Using “pfexec ln -s” for example, make symbolic links to GCC from /usr/bin/gcc-4.3.2 to /usr/bin/gcc and /usr/sfw/bin/gcc. Take note of which gcc version you have and construct your ln -s command appropriately.
  • Update your rubygems installation: “pfexec gem update –system”.
  • If you are compiling gems, you will need rake: “pfexec gem install rake”.
  • If you need sqlite3-ruby gem, you will need to download and compile a newer version of sqlite3 from the website as the OpenSolaris package is currently too old to build the gem.

That should be enough to get you going. Try installing gems now either from shell or netbeans with superuser privileges. If you run into errors, take close note of the error messages while compiling the gem, and the output logs. You can generally work out what is required from the fairly verbose errors.

You may see this type of error:

art@sol:~$ irb
irb(main):001:0> require “bcrypt”
LoadError: no such file to load — bcrypt
from (irb):1:in `require’
from (irb):1

One way to resolve this is to run ruby or irb with the -rubygems option:

art@sol:~$ irb -rubygems
irb(main):001:0> require “bcrypt”
=> true

Hope this helps!

Written by art

November 11th, 2010 at 7:45 pm

Leave a Reply