Compiling Ruby 1.8.6 on Ubuntu

July 17, 2007 @ 09:26 AM | posted by carmelyne

(last updated: 08.09.07)

Lets do this quickly:

Note: This is not for an upgrade.

  1. cd /usr/src
  2. sudo wget http://rubyforge.org/frs/download.php/18421/ruby-1.8.6.tar.gz
  3. sudo tar -xvf ruby-1.8.6.tar.gz
  4. cd ruby-1.8.6
  5. sudo apt-get install build-essential
  6. ./configure
  7. make test
  8. make
  9. sudo make install
  10. ruby -v (# == ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux])
  11. irb (# make sure irb works)

Then just do a quick update sweep for ubuntu:

  1. apt-get update
  2. apt-get dist-upgrade

UPDATE: Getting script/console to work

Error:
/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require’: no such file to load – readline (LoadError)

Eeek now script/console won't work. So let's fix that. We'll go back to the archive and do the following:

  1. cd /usr/src/ruby-1.8.6/ext/readline
  2. ruby extconf.rb
  3. make
  4. sudo make install

Do I need a disclaimer? Hey! I was on my own too when I did this compile. ;p

[ Last updated: August 09, 2007 @ 05:16 PM ]


4 Responses to...
“Compiling Ruby 1.8.6 on Ubuntu”

  1. Zak Mandhro:

    If you want to see how to compile related programs, such as Pound and Memcache, on Ubuntu, see http://mandhro.com/2007/01/11/edgy-on-rails-get-compiling/



    Posted:
  2. carmelyne:

    Thanks, Zak. That's a very good article.



    Posted:
  3. Raghav:

    Hi,

    I came to this page through a suggestion in the rails forum. My irb doesnt support history and the script/console doesn't work.

    Following your suggestions for compiling, it went through fine. ruby is compiled and seems to be fine...

    However, the original reason for which I started the whole process still remains. I still dont have history on irb and script/console still doesn't work.. :(

    I am running Ubuntu Feisty Fawn on Core2Duo Hp 6710b.. any clues ??

    regards raghav..



    Posted:
  4. carmelyne:

    Hi Raqhav,

    Did you do the update part?

    1. cd /usr/src/ruby-1.8.6/ext/readline
    2. ruby extconf.rb
    3. make
    4. sudo make install

    Carmelyne



    Posted:

Sorry, comments are closed for this article.

Snippets of 06/24/07

Rails 'A'..'Z' Paginate

1
2
3
4
5
6
7
8
9
10
11
# Starts with 'A'..'Z' Paginate / model
def self.sort(sort)
  if sort
    find(:all, :conditions => ['name LIKE ?', "#{sort}%"])
  else
    find(:all, :order => 'name')
  end  
end

# index action / controller
@models = Model.sort(params[:sort]) 
RailsConf 2006
I heart devChix