Skip to content

Instantly share code, notes, and snippets.

@dingzj
Forked from HatemMahmoud/Ubuntu rbenv
Last active December 25, 2015 05:49
Show Gist options
  • Save dingzj/6927171 to your computer and use it in GitHub Desktop.
Save dingzj/6927171 to your computer and use it in GitHub Desktop.
# For more info: https://gist.github.com/1120938
# http://www.stehem.net/2012/05/08/how-to-install-ruby-with-rbenv-on-ubuntu-12-04.html
# http://vvv.tobiassjosten.net/ruby/readline-in-ruby-with-rbenv/
sudo apt-get install zlib1g-dev openssl libopenssl-ruby1.9.1 libssl-dev libruby1.9.1 libreadline-dev
sudo apt-get install build-essential curl git-core sqlite3 libsqlite3-dev
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.3-p448 ~/.rbenv/versions/1.9.3-p448 --with-openssl-dir=/usr/local --with-readline-dir=/usr/include/readline
# Install shims for all Ruby binaries
rbenv rehash
# Set default Ruby version
rbenv global 1.9.3-p448
# Check Ruby
ruby -v #ruby 1.9.3-p448
# Check OpenSSL
irb
require 'openssl' # => true
# for more info: https://gist.github.com/1120938
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment