homebrew + rbenv + ruby-build
Installation of homebrew.
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
Installation of required packages.
brew install openssl
brew install readline
brew install libyaml
brew install autoconf
brew list -1 | egrep "openssl|readline|libyaml|autoconf"
Installation of rbenv
and ruby-build
.
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
mkdir -p ~/.rbenv/plugins
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
Edit .bashrc
.
# ~/.bashrc
# Add the following.
if [ -d $HOME/.rbenv ]; then
export PATH=$PATH:$HOME/.rbenv/bin
eval "$(rbenv init -)"
fi
Installation of ruby
by ruby-build
.
source ~/.bashrc
rbenv install 2.0.0-p195
rbenv global 2.0.0-p195
ruby -v
Installation of gem frequently used.
gem i bundler
gem i pry pry-doc
gem i rspec
gem update rake