Skip to content

Instantly share code, notes, and snippets.

@willianjusten
Created November 23, 2013 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willianjusten/7610558 to your computer and use it in GitHub Desktop.
Save willianjusten/7610558 to your computer and use it in GitHub Desktop.
A simple step-by-step to install Ruby and Rails.
#!/bin/bash
# update packages
sudo apt-get update
# installing dependencies
sudo apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libssl-dev mysql-client libmysqlclient-dev
# go to the page ~
cd
# cloning the repo and setting in the PATH
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
# cloning the repo
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
# using rbenv to install the latest version of ruby
rbenv install 2.0.0-p247
rbenv global 2.0.0-p247
# changing to don't install docs for all gems
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
# updating the system and installing rails
gem update --system
gem install rails
# making rails executable
rbenv rehash
# showing the version of rails
rails -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment