Ruby Native Gem Support on Open Solaris

We integrated Ruby into Open Solaris build 78! From build 78 onwards, you can use ruby 1.8.6 and ruby gems 0.9.4 with Openssl, Curses, Readline, and Tcl/Tk extensions enabled :)

Ruby and Ruby Gems are available in /usr/ruby and have been linked form /usr/bin for easy use! So, in case you want to install a gem, all you need to do is issue the '(/usr/bin/)gem install ' command! If you are behind a proxy, do not forget to set your proxy - export http_proxy="http://:"

However, for native gems, you need to make some changes to your rbconfig.file (in /usr/ruby/1.8/lib/ruby/1.8/-solaris-)

If you are using Sun Studio, make sure you have /opt/SUNWspro/bin in your path and make the following changes to your rbconfig.rb file.

CONFIG["CC"] = "cc"
CONFIG["CFLAGS"] = "-xO3 -xbuiltin=%all -xinline=auto -xprefetch=auto -xdepend -KPIC"
CONFIG["LDFLAGS"] = "-L. -L/usr/sfw/lib -R/usr/sfw/lib"
CONFIG["CPPFLAGS"] = "-DTEXT_DOMAIN=\\"\\" -I/usr/sfw/include -I/usr/include"
CONFIG["CPP"] = "cc -E
CONFIG["CCDLFLAGS"] = "-KPIC"

If you are using GNU compiler tools, make sure you have gcc, g++, etc (usually /usr/sfw/bin) in your path and make the following changes to your rbconfig.rb file.

CONFIG["CC"] = "gcc"
CONFIG["CFLAGS"] = "-g -O3 -fPIC"
CONFIG["LDFLAGS"] = "-L. -L/usr/sfw/lib -R/usr/sfw/lib"
CONFIG["CPPFLAGS"] = "-DTEXT_DOMAIN=\\"\\" -I/usr/sfw/include -I/usr/include"
CONFIG["CPP"] = "gcc -E"
CONFIG["CCDLFLAGS"] = "-fPIC"

Voila! you are done and ready to use the gem command to install native gems on the fly!!
Well, this is just for the time being, these changes will also be integrated into Open Solaris soon so that native gem support too will be enabled by default! Shall blog about that once the integration is done!

Comments:

Also, I switched /usr/sbin/install to /usr/bin/ginstall to fix errors like:
...
find: cycle detected for DIRNAME
install: FILE_NAME was not found anywhere!

Posted by Todd Willey on September 30, 2008 at 03:33 PM IST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

gkrish

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today