Skip to content

Instantly share code, notes, and snippets.

@eerohele
Created January 4, 2013 12:11
Show Gist options
  • Save eerohele/4452180 to your computer and use it in GitHub Desktop.
Save eerohele/4452180 to your computer and use it in GitHub Desktop.
Installing Ruby 1.8.5 on Ubuntu with rbenv
  1. Install rbenv.

  2. Download and compile OpenSSL 0.9.8x:

     $ tar zxvf openssl-0.9.8x.tar.gz
     $ cd openssl-0.9.8x
     $ ./config
     $ make
     $ make test
     $ make install
    
  3. Download Ruby 1.8.5 and extract the archive:

     $ tar zxvf ruby-1.8.5.tar.gz
    
  4. Fix typo in ruby-1.8.5/math.c:

     $ cd ruby-1.8.5
     $ nano -c math.c
    
     // Change line 37 from this:
     #elif define(ERANGE)
    
     // To this:
     #elif defined(ERANGE)
    
  5. Comment out lines in openssl/bn.h:

     $ sudo nano -c /usr/local/ssl/include/openssl/bn.h
     // Comment out lines 411 and 412.
    
  6. Compile Ruby 1.8.5:

     $ ./configure --prefix=$HOME/.rbenv/versions/1.8.5 --with-openssl-dir=/usr/local/ssl
     $ make
     $ make install
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment