Prashant Srinivasan's Weblog
How to install Mongrel, Mysql, and Postgres gems in OpenSolaris Ruby -
Rubygems is the preferred package manager for Ruby, and Ruby packages are called gems. While most of the gems out there are written in Ruby, there are a few that have C or C++ code in them for performance(like Fastthread for Mongrel), or Features(like the MySQL connector for Ruby).
Such gems need a C/C++ compiler to successfully be installed. Apart from that, they also need an appropriately configured rbconfig.rb file in the Ruby installation.
The rbconfig.rb file is typically present in lib/ruby/site_ruby/1.8/rubygems.rb - on OpenSolaris, it is present as /usr/ruby/1.8/lib/ruby/site_ruby/1.8/rubygems.rb
The rbconfig.rb file contains, among other things, information about which compiler(ie., the location) was used to build Ruby, compiler flags, linker flags, path to the C++ compiler, location of ginstall etc.,
This is strictly not necessary for C applications, ie., you can install a native gem compiled with CompilerB on a version of Ruby that was compiled with CompilerA, but the advantage of having the build time compiler flags captured is that you can optimize the extensions just as the Ruby binary was optimized(and the folks who built Ruby for you hopefully have done some reasearch in this area).
On OpenSolaris, there's a bug by which some paths in the rbconfig.rb file actually point to a compiler location that was used by the build infrastructure, and this location is normally not present on the system.
This is a bug that is being fixed, and the right paths should work out of the box. Until that fix shows up in the repository, here's how to make sure your Ruby installation works well.
Posted at 03:12PM May 19, 2008 by prashant in Ruby | Comments[3]
Today's Page Hits: 189
| « June 2009 | ||||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 20 | |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | ||||
| Today | ||||||
Does the rbconfig.rb bug exist on opensolaris 2008.05 also? Does the new packaging system (IPG?) fix it?
Posted by realneel on May 20, 2008 at 09:29 PM PDT #
Unfortunately it's not fixed in the IPS repository(or in Solaris Nevada).
That should change pretty soon, though.
Posted by Prashant Srinivasan on May 22, 2008 at 04:18 PM PDT #
Thanks for this post.
Since you're doing solaris / ruby, I figured I'd ask my question. I'm running sol10 sparc on a T1000.
I have an issue with rubygems where it just takes forever to run! If I truss the "gem install rails" process, I get something like this:
(lots of getcontext)
/1: getcontext(0xFFBCD9F0)
/1: getcontext(0xFFBCCF98)
/1: getcontext(0xFFBCC950)
/1: getcontext(0xFFBCC950)
/1: getcontext(0xFFBCD620)
/1: getcontext(0xFFBCD618)
/1: getcontext(0xFFBCD9F0)
/1: getcontext(0xFFBCCF98)
/1: getcontext(0xFFBCC950)
^C/2: nanosleep(0xFEB7BF88, 0xFEB7BF80) = 0
If you've seen this before, how did you solve the issue?
I've tried compiling from source, installing from various binaries, but no luck in clearing this particular issue.
Thanks in advance,
Jeff
Posted by Mirage on May 23, 2008 at 01:51 PM PDT #