Ruby version manager, Ubuntu and openssl
RVM (Ruby Version Manager) is a hot tool which makes switching between Rubys (1.8.6, 1.8.7, 1.9.1, JRuby, you name it) as simple as `rvm use 1.9.1`. However, on Ubuntu, you may hit trouble when using the openssl package for any non-system provided Ruby version.
Fixing openssl for Rvm-provided Ruby's
On Ubuntu, apt is most commonly used to administrate Ruby. Using apt, openssl is a separate package (
libopenssl-ruby). This installs openssl for your apt-provided Ruby, which will most likely be /usr/lib/ruby/1.8/openssl. Rvm-provided Ruby's can't access this, however, so you need to build openssl for each rvm-provided Ruby you install.
The trick for this is to get the libssl-dev from apt before building openssl, otherwise you'll have trouble configuring it. So, to get openssl on a rvm-provided Ruby, simply do:
sudo apt-get install libssl-dev
cd ~/.rvm/src/ruby-1.8.7/ext/openssl
ruby extconf.rb
make && make install
Voila!
Update: readline
Trying to fire up `script/console` from a rvm-provided Ruby I hit a similar problem with the readline library. It can be fixed in much the same way:
sudo apt-get install libreadline5-dev
cd ~/.rvm/src/ruby-1.8.7/ext/readline
ruby extconf.rb
make && make install
Once again, voila!
Comments
Wayne E. Seguin
(http://beginrescueend.com)
18. September, 02:59
Additionally if you wish to use jRuby you will need:
sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk
A running list of such pre-requirements to use rvm (since it compiles the rubies on each machine) can be found here:
http://rvm.beginrescueend.com/requirements/
If you have any questions or feedback for rvm please visit #rvm on irc.freenode.net!!!
Thanks!
~Wayne
Comments are closed