Skip to content

Instantly share code, notes, and snippets.

@jimmynguyc
Last active December 15, 2015 14:30
Show Gist options
  • Save jimmynguyc/e22297209cad3cbca19f to your computer and use it in GitHub Desktop.
Save jimmynguyc/e22297209cad3cbca19f to your computer and use it in GitHub Desktop.
Installing Rails on Koding.io
#! /bin/bash
# Run with: bash <(curl -L http://bit.ly/install-rails-on-koding-v4_2)
date1=$(date -u +"%s")
sudo apt-get update
sudo apt-get -y install build-essential zlib1g zlib1g-dev sqlite3 libsqlite3-dev git libssl-dev libreadline-dev libxml2-dev libpq-dev nodejs
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install 2.2.3
rbenv global 2.2.3
gem install bundler --no-rdoc --no-ri
gem install rails --no-rdoc --no-ri
rbenv rehash
date2=$(date -u +"%s")
diff=$(($date2-$date1))
clear
echo "Done installing Ruby 2.2.3 and Rails ..."
echo "$(($diff / 60)) minutes and $(($diff % 60)) seconds elapsed."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment