yum install ruby
This installed version 1.8.5 for me instead of the latest 1.9 version; so I have to rollback and build this from source
To find out the rpm's installed,
rpm -qa | egrep '(ruby)|(irb)'
To uninstall
rpm -e ruby-libs-1.8.1-7.EL4.2
This gave an error :multiple packages installed. Fortunately for this page, it was easy to figure out why, and the following worked!
rpm -e ruby-libs-1.8.5-5.el5_4.8.i386
rpm -e ruby-libs-1.8.5-5.el5_4.8.x86_64
To install the latest version, I'd have to build this from source, and this link proved useful.
# download the required ruby version
wget ftp://ftp.ruby-lang.org:21//pub/ruby/1.9/ruby-1.9.2-p0.tar.gz
tar xvfz ruby-1.9.2-p0.tar.gz
cd ruby-1.9.2-p0
./configure --prefix=/usr (the default prefix is /usr/local)
make
make test
make install
Rubygems is included as part of ruby 1.9.2 installation, so no need to build this from source.
However, the gem list command failed as follows
[root@jbserver4 lib]# gem list
ERROR: Loading command: list (LoadError)
no such file to load -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::ListCommand
This got resolved thanks to the information provided here. What was required was the installation of zlib-devel, which is simply done as follows
yum install zlib-devel
The ruby build needs to be done again.
This time around I gave a little more attention to the build commands being fired, I found a couple of 'missing' libraries as follows
..
..
make[1]: Entering directory `/disk1/downloads/ruby-1.9.2-p0/ext/fiber'
gcc -shared -o ../../.ext/x86_64-linux/fiber.so fiber.o -L. -L../.. -L. -rdynamic -Wl,-export-dynamic -lpthread -lrt -ldl -lcrypt -lm -lc
make[1]: Leaving directory `/disk1/downloads/ruby-1.9.2-p0/ext/fiber'
compiling fiddle
ffi.h is missing. Please install libffi.
compiling gdbm
..
..
compiling openssl
compiling psych
yaml.h is missing. Please install libyaml.
compiling pty
..
..
..
check struct members..
check libraries....
Use ActiveTcl libraries (if available).
Search tclConfig.sh and tkConfig.sh...................
Fail to find [tclConfig.sh, tkConfig.sh]
Use X11 libraries.
Warning:: cannot find X11 library. tcltklib will not be compiled (tcltklib is disabled on your Ruby == Ruby/Tk will not work). Please check configure options. If your Tcl/Tk don't require X11, please try --without-X11.
Can't find X11 libraries. So, can't make tcltklib.so which is required by Ruby/Tk.
compiling tk/tkutil
..
..
..
Inspite of these, the installation seems to work...so maybe i'll revisit these if I have a problem...
The one thing that didnt work was 'rails console'. This post helped in resolving the issue.
yum install readline readline-devel
cd ruby-source/ext/readline
ruby extconf.rb
make
make install
No comments:
Post a Comment