Last active
August 29, 2015 14:14
-
-
Save furaibo/dbdfc6e18bb3cbe8e547 to your computer and use it in GitHub Desktop.
rbenv及び最新版のrubyをインストール・設定するシェルスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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