What's the best way to compile Ruby from source on 64-bit RedHat Linux
In RedHat Enterprise Linux 5, the latest Ruby available through RPM is 1.8.5. My Rails application requires 1.8.6 or higher, so I need to compile Ruby from source.
I tried the following to build it and it seems to be built fine, but then I see gcc compilation errors when I try to run a plugin that requires RubyInline.
There doesn't seem to be enough documentation for building Ruby from source, suitable for running Rails applications.
This is how I compiled Ruby:
./configure --prefix=/usr --with-openssl-include=/usr/include/openssl --with-openssl-lib=/usr/lib64/openssl/engines
make
sudo make install
I wonder if there are specific compilation flags that I need to build on a 64-bit system. The actual error I see is -
error executing "gcc -shared -fPIC -g -O2 -I /usr/lib/ruby/1.8/x86_64-linux -I /usr/include -L/usr/lib -o \"/home/deploy/.ruby_inline/Inline_ImageScience_aa58.so\" \"/home/deploy/.ruby_inline/Inline_ImageScience_aa58.c\" -lfreeimage -lstdc++ ":
Any advice would be greatly appreciated
source to share
The best way would probably be to simply "steal" the Ruby 1.8.6 RPM from Fedora. The second best way would be to steal SRPM Ruby 1.8.6 from Fedora and build it yourself.
However, there is one thing you could do: add a flag --disable-pthread
to the line configure
and remove --enable-pthread
if there is one. --enable-pthread
makes MRI significantly slower and is only required if you want to use Ruby / Tk and your Tk library system was built with --enable-pthread
.
source to share
Ruby packages for Fedora (including SRPM)
Failed to post comment on correct answer, added here - editors are free to clean up.
source to share