Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bash Script for Ubuntu RoR Setup - STC Summer 2012
#!/bin/bash
# This probably won't run as a script, but you can copy sections at a time.
# Before running, change CAPITAL LETTERS to the appropriate variables you have
#When you get stuck on installation for "ttf-mscorefonts-installer", press [Tab] then [Return] to accept the agreement.
sudo apt-get update
sudo apt-get install mysql-server mysql-client
sudo apt-get install libmysql-ruby libmysqlclient-dev
sudo apt-get install build-essential mysql-server gedit-plugins ri phpmyadmin msttcorefonts openjdk-6-jdk git-core
sudo apt-get install sqlite3 libsqlite3-dev libsqlite3-ruby
sudo apt-get install rubygems
sudo apt-get install imagemagick
sudo apt-get install libssl-dev
#Install Nokogiri dependencies, as described on http://nokogiri.org/tutorials/installing_nokogiri.html
sudo apt-get install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8
sudo apt-get install libreadline-ruby1.8 libruby1.8 libopenssl-ruby
sudo apt-get install libxslt-dev libxml2-dev
#Install rbenv
#https://github.com/sstephenson/rbenv
cd ~
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
#Install ruby in rbenv
#https://github.com/sstephenson/ruby-build
mkdir -p ~/.rbenv/plugins
cd ~/.rbenv/plugins
git clone git://github.com/sstephenson/ruby-build.git
rbenv install 1.9.2-p290
#Set up git
#http://help.github.com/set-up-git-redirect/
git config --global user.name "YOUR NAME HERE"
# Sets the default name for git to use when you commit
git config --global user.email "YOUREMAIL@EMAIL.COM"
# Sets the default email for git to use when you commit
git config --global credential.helper cache
# Set git to use the credential memory cache
git config --global credential.helper 'cache --timeout=3600'
# Set the cache to timeout after 1 hour (setting is in seconds)
#DO THIS: https://help.github.com/articles/generating-ssh-keys
#Connect to STC Reservations
#https://github.com/YaleSTC/reservations
mkdir ~/code
cd ~/code
git clone git@github.com:YaleSTC/reservations.git
cd reservations
#Install Rails
gem install rails
#Install Bundler
#don't everr do "sudo gem install bundler"
gem install bundler
exec $SHELL
#for some reason paperclip doesnt like to be bundler installed?
gem install paperclip
cd ~/code/reservations
bundle install
#Connect reservations to your database
cd ~/code/reservations
cp config/database.yml.example config/database.yml
#open in your text editor, and configure it for your system
gedit config/database.yml
#Run Migrations and Start Server
rake db:create
rake db:migrate
rails server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment