Last active
August 29, 2015 14:18
-
-
Save oneamitj/6c2c91d027a2ac938f0c to your computer and use it in GitHub Desktop.
Ruby on Rails installer for linux.
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 | |
# Some Color coding | |
red='\e[31m' | |
grn='\e[32m' | |
yel='\e[33m' | |
blu='\e[34m' | |
pnk='\e[35;40m' | |
org='\e[33;40m' | |
wht='\e[0m' | |
echo | |
echo -e "$red Password please:: $wht" | |
sudo echo | |
# First install requirements for RoR projects | |
echo -e "$wht Installing Requirements for RoR projects. $wht" | |
echo | |
echo -e "$org Installing Git $wht" | |
sudo apt-get install git -y | |
echo | |
echo -e "Installing MySQL" | |
sudo apt-get install mysql-server mysql-client libmysqlclient-dev -y | |
echo | |
echo -e "Installing 'gem' command required to install Ruby Gems $wht" | |
sudo apt-get install gem -y | |
echo | |
echo | |
echo | |
echo -e "$org Downloading GPG Signature to install RVM Package Manager $wht" | |
# GPG Signature verification to download rvm package manager | |
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 | |
echo | |
echo | |
echo -e "$grn GPG Verified $wht" | |
echo | |
echo | |
echo | |
echo -e "$org Downloading and Installing RVM Package Manager... $pnk TAKE A WALK ITS HEALTHY AND THIS PROCESS MAY TAKE SOME TIME :D $wht" | |
echo | |
echo | |
# Download and install rvm | |
\curl -sSL https://get.rvm.io | bash | |
echo -e "$grn RVM Installed Successfully $wht" | |
echo | |
echo | |
echo | |
echo -e "$yel Adding RVM to PATH variable $wht" | |
#export RVM to path | |
PATH=$PATH:$HOME/.rvm/bin | |
echo "$grn RVM Added" | |
echo | |
echo | |
echo | |
echo -e "$org Installing Ruby v2.2.1... $pnk KEEP CALM IT MAY TAKE MINUTES, I SUGGEST TO GET A CUP OF COFFEE :) $wht" | |
source ~/.bashrc | |
# Install Ruby v2.2.1 | |
rvm install ruby-2.2.1 | |
echo | |
echo | |
echo -e "$grn Ruby v2.2.1 successfully installed $wht" | |
echo | |
/bin/bash --login | |
echo | |
echo | |
echo -e "$yel Making Ruby v2.2.1 default in your system $wht" | |
# Make Ruby v2.2.1 default | |
rvm use ruby-2.2.1 --default | |
echo -e "$grn Ruby v2.2.1 is now default $wht" | |
echo | |
echo -e "$pnk I think you love Gems, I'm getting lots of them for you... But it will take time to collect all, so wait a bit... OKIE $wht" | |
# Install Rails v3.2 and Gems | |
gem install rails --version "=3.2" --no-document | |
gem install bundler | |
echo | |
echo | |
echo -e "$grn All 29 gems are collected successfully and safely stored for you in your system :) $wht" | |
echo | |
echo -e "$grn You have got all the requirements. $wht" | |
echo -e "$yel These are list that you installed. $wht" | |
rvm -v | |
rvm list | |
echo | |
echo -e "$blu If above results shows 'rvm version' and '=* ruby-2.2.1', everything is successfully installed $wht" | |
echo -e "$red If not feel free to contact me @ wannamit@gmail.com $wht" | |
echo -e "$grn Happy programming with $red RoR $wht" | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just run this command in terminal... enter password if asked...
For getting started with RoR: