Skip to content

Instantly share code, notes, and snippets.

@HatemMahmoud
Created September 7, 2011 12:56
Show Gist options
  • Star 39 You must be signed in to star a gist
  • Fork 18 You must be signed in to fork a gist
  • Save HatemMahmoud/1200482 to your computer and use it in GitHub Desktop.
Save HatemMahmoud/1200482 to your computer and use it in GitHub Desktop.
Installing Ruby 1.9.2 with OpenSSL on Ubuntu 11.04 using ruby-build and rbenv
# For more info: https://gist.github.com/1120938
cd
git clone git@github.com:sstephenson/rbenv.git ~/.rbenv
# Add rbenv to your PATH
echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"' >> ~/.bash_profile
# Install ruby-build
git clone git@github.com:sstephenson/ruby-build.git
cd ruby-build
./install.sh
# $ which openssl
# /usr/bin/openssl
# Install Ruby with OpenSSL option
ruby-build 1.9.2-p290 ~/.rbenv/versions/1.9.2-p290 --with-openssl-dir=/usr/local
# Install shims for all Ruby binaries
rbenv rehash
# Set default Ruby version
rbenv global 1.9.2-p290
# Check Ruby
ruby -v #ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
# Check OpenSSL
irb
require 'openssl' # => true
# for more info: https://gist.github.com/1120938
@pburleson
Copy link

Thanks for this gist. It's odd that the --with-openssl-dir parameter needs /usr/local/ considering there's nothing about OpenSSL in there via the Ubuntu packages.

@hoffmanc
Copy link

Yes this is clearly partial...

@omps
Copy link

omps commented May 19, 2015

this doesn't seem to work with ruby 2.0.0

@omps
Copy link

omps commented May 19, 2015

In the source location, cd ext/openssl and then ruby extconf.rb. This will generate a makefile in the ext/openssl directory. Simply make && sudo make install it to build the ruby openssl extension, and install the .so into the appropriate location.

and the same for ext/readline for readline support.

Then you should be able to make ruby properly.

cd ext/openssl
ruby extconf.rb
make && sudo make install

cd ext/readline
ruby extconf.rb
make && sudo make install

make
sudo make install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment