Tuesday, March 17, 2009

Install Ruby 1.9.1

openSUSE's package system is rpm, and openSUSE 11.1 supports ruby 1.8.7
>rpm -q ruby
ruby-1.8.7.p72-5.3
>which ruby
/usr/bin/ruby
>ruby -e "puts $:"
/usr/lib64/ruby/site_ruby/1.8
/usr/lib64/ruby/site_ruby/1.8/x86_64-linux
/usr/lib64/ruby/site_ruby
/usr/lib64/ruby/vendor_ruby/1.8
/usr/lib64/ruby/vendor_ruby/1.8/x86_64-linux
/usr/lib64/ruby/vendor_ruby
/usr/lib64/ruby/1.8
/usr/lib64/ruby/1.8/x86_64-linux

So I planned to install ruby 1.9.1 not on /usr/, on /opt/. First, get the source code from here, uncompress, and change directory. then CMMI instructions start, with some configure options.
>./configure --prefix=/opt/ruby-1.9.1 --enable-shared
>make
>sudo make install

--prefix option decides installation root(/opt/ruby-1.9.1), --enable-shared option builds ruby and its shared library(ex. libruby.so.1.9.1). Actually, I forgot --enable-shared option, then build of ruby itself succeeds, but in later instruction, I met some failures. I will post about it later.

No comments:

Post a Comment