rbnevのインストール
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
ruby-buildのインストール
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
必要パッケージのインストール
sudo apt-get install libssl-dev
rubyのインストールと有効化
rbenv install 2.1.2
rbenv rehash
rbenv gloval 2.1.1
rubyのバージョン確認
rbenv version
ruby -v
以上です。
不足や間違いがありましたら指摘していただけると嬉しいです。
参考
https://github.com/sstephenson/rbenv
http://krakenbeal.blogspot.jp/2012/03/ubunturbenvruby-buildruby.html
https://github.com/sstephenson/ruby-build/issues/526#issuecomment-37933242
http://qiita.com/kazoo04/items/7056704efee66f323ddb