Skip to content

Instantly share code, notes, and snippets.

@furaibo
Last active August 29, 2015 14:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save furaibo/dbdfc6e18bb3cbe8e547 to your computer and use it in GitHub Desktop.
rbenv及び最新版のrubyをインストール・設定するシェルスクリプト
#!/bin/bash
# install git
sudo apt-get -y install git
# get rbenv
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
# set rbenv path
echo '' >> ~/.bashrc
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
# get the latest version of ruby
ver=`rbenv install --list | grep "^ [0-9].[0-9].[0-9]$" | tail -n 1 | tr -d ' '`
rbenv install $ver
rbenv global $ver
unset ver
# rbenv rehash
rbenv rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment