rbenvのRuby 環境の構築

rbenvのインストール

$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
 
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
 
$ source ~/.bash_profile
$ rbenv --version
rbenv 0.4.0-97-gfe0b243

 

 

Ruby のインストール

rbenv install --list 
何のバージョンがあるか確認

rbenv install 2.2.0
インストール

 

インストールした ruby に環境を切り替える

$ rbenv rehash
$ ruby -v
rbenv: version `system' is not installed
$ rbenv global 2.2.0
$ rbenv version
2.2.0 (set by /home/vagrant/.rbenv/version)
$ ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]

Ruby on Rails のインストール

$ gem update --system
$ gem install --no-ri --no-rdoc rails
$ gem install bundler
$ rbenv rehash

 

参考サイト

http://qiita.com/murachi1208/items/f3f15b41d6651cc57368