Created
November 23, 2013 03:52
-
-
Save willianjusten/7610558 to your computer and use it in GitHub Desktop.
A simple step-by-step to install Ruby and Rails.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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