Patrick Galbraith (capttofu) wrote,

Getting Ruby and Rake versions sorted out

I've been working on updating the various libmemcached wrapper drivers to the latest libmemcached and was having an issue trying to build the Ruby libmemcached client, Fauna (developed by Evan Weaver) due to my Ubuntu box originally having Ruby 1.8 installed but gem would install modules that are needed for Fauna - echoe and mocha - into the 1.9 library directory. I found this useful post here: which I modified and this here is the script I ended up using that will allow Fauna to build:


aptitude -y install ruby1.9.1 ruby1.9.1-dev \
        libopenssl-ruby1.9.1 rubygems1.9.1 irb1.9.1 ri1.9.1 rdoc1.9.1 g++

# If you already have 1.8 installed
update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.8 500 \
        --slave   /usr/share/man/man1/ruby.1.gz ruby.1.gz \
            /usr/share/man/man1/ruby.1.8.gz \
        --slave   /usr/bin/ri ri /usr/bin/ri1.8 \
        --slave   /usr/bin/irb irb /usr/bin/irb1.8 \
        --slave   /usr/bin/rdoc rdoc /usr/bin/rdoc1.8

# Install ruby1.9.1
update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.9.1 400 \
         --slave   /usr/share/man/man1/ruby.1.gz ruby.1.gz \
                                   /usr/share/man/man1/ruby1.9.1.1.gz \
        --slave   /usr/bin/ri ri /usr/bin/ri1.9.1 \
         --slave   /usr/bin/irb irb /usr/bin/irb1.9.1 \
        --slave   /usr/bin/rdoc rdoc /usr/bin/rdoc1.9.1

# choose your interpreter
# changes symlinks for /usr/bin/ruby ,
# /usr/bin/irb, /usr/bin/ri and man (1) ruby
update-alternatives --config ruby
update-alternatives --config gem

gem update
gem install echoe
gem install mocha

And if you now run:

patg@patg-desktop:~/code_dev/ruby-memcached$ ruby --version
ruby 1.9.1p378 (2010-01-10 revision 26273) [x86_64-linux]
patg@patg-desktop:~/code_dev/ruby-memcached$ gem --version
patg@patg-desktop:~/code_dev/ruby-memcached$ rake --version
rake, version 0.8.7

Tags: fauna, libmemcached, library path ruby, memcached, ruby, ubuntu
  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic
  • 1 comment