Setting up Ruby development environments

Ruby

Install development libraries

1
2
sudo apt-get -y update
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev

Install rbenv

1
2
3
4
5
6
7
cd ~
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile

Install ruby

1
2
3
rbenv install -v 2.3.1
rbenv global 2.3.1
ruby -v

Install gems

1
2
3
4
gem install bundler
gem install nokogiri
gem install rails
rbenv rehash
Share