Skip to content

Instantly share code, notes, and snippets.

@canweriotnow
Forked from havenwood/chruby_ruby-build.sh
Last active August 13, 2019 10:46
Show Gist options
  • Select an option

  • Save canweriotnow/da94e1fd000fbbfb2d5411efbb049d78 to your computer and use it in GitHub Desktop.

Select an option

Save canweriotnow/da94e1fd000fbbfb2d5411efbb049d78 to your computer and use it in GitHub Desktop.
On Debian, Ubuntu, or Mint: install Ruby 2.3.1 with chruby and ruby-build, ruby-install, and gem_home
# Install apt-get packages:
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
# Install chruby:
cd
wget https://github.com/downloads/postmodern/chruby/chruby-0.2.3.tar.gz
tar -xzvf chruby-0.2.3.tar.gz
cd chruby-0.2.3
make install
# Install ruby-build:
git clone git@github.com:sstephenson/ruby-build.git
cd ruby-build
./install.sh
# Install 1.9.3 with OpenSSL:
ruby-build 1.9.3-p327 ~/usr/local/1.9.3-p327 --with-openssl-dir=`which openssl`
# Add the following to .bashrc (or .zshrc whatev):
. /usr/local/share/chruby/chruby.sh # Load chruby
RUBIES=(
~/usr/local/1.9.3-p327
# Path to other Rubies here...
)
chruby 1.9.3 # Select default Ruby
# Check that OpenSSL Works:
irb -r openssl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment