Register now and start sharing your code snippets.
-->

Compiling Ruby with OpenSSL, Zlib and Readline support on Debian

Ruby posted 8 months ago by christian

DRAFT … From http://blog.fiveruns.com/2008/3/3/compiling-ruby-rubygems-and-rails-on-ubuntu

Install pre-requisites

   1  apt-get -y install build-essential libssl-dev libreadline5-dev zlib1g-dev

Download and install

   1  cd /usr/local/src
   2  
   3  wget http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.gz
   4  
   5  tar zxvf ruby-1.8.6.tar.gz
   6  
   7  cd ruby-1.8.6.tar.gz
   8  
   9  ./configure --prefix=/usr/local --with-openssl-dir=/usr --with-readline-dir=/usr --with-zlib-dir=/usr
  10  
  11  make
  12  make install
  13  
  14  ruby -ropenssl -rzlib -rreadline -e "puts :success" 
  15  

Tagged ruby, readline, ssl, zlib, debian

Solution to "`require': no such file to load -- readline (LoadError)" problem

Shell Script (Bash) posted about 1 year ago by christian

If you’ve compiled Ruby from source, you might get this error when executing script/console:

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

One way of fixing this is to compile readline, which is distributed along with the Ruby source:

   1  cd /opt/src/ruby-1.8.5-p2/ext/readline
   2  ruby extconf.rb
   3  make
   4  sudo make install

This works even after compiling Ruby, so no need to recompile… If you’re wondering what readline is then this quote from the project homepage sums it up in one sentence: “The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are typed in.”

Tagged readline, ruby, console, compile