Skip to content

Instantly share code, notes, and snippets.

@selvan
Created July 20, 2012 04:17
Show Gist options
  • Save selvan/3148660 to your computer and use it in GitHub Desktop.
Save selvan/3148660 to your computer and use it in GitHub Desktop.
Rvm, Ruby and Rails
# change shell to bash
export SHELL=/bin/bash
# install mysql lib
sudo apt-get install libmysqlclient-dev
# install openssl & dev files
sudo apt-get install libssl-dev openssl
# install smb client libs
sudo apt-get install libsmbclient libsmbclient-dev
# install libreadline5
sudo apt-get install libreadline5-dev
# install v8 headers
sudo apt-get install libv8-dev
# install build essentials
sudo apt-get install build-essential
# install rvm
curl -L get.rvm.io | bash -s stable
# install ruby
#rvm remove ruby-1.9.3-p0
rvm install ruby-1.9.3-p0 --with-openssl-dir=/usr/include/openssl/ --with-readline-dir=/usr/include/readline/
# ask rvm to use ruby-1.9.3-p0
rvm use ruby-1.9.3-p0
# create gemset for Rails 3.2.5 & ruby-1.9.3-p0
rvm use --create [email protected]
# download & install ruby-gem
wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.24.tgz
tar -zxvf rubygems-1.8.24.tgz
cd rubygems-1.8.24
ruby setup.rb
# install bundler
gem install bundler
# change db auth config, if required
vi config/database.yml
# set rails env
export RAILS_ENV=development
#export RAILS_ENV=production
#export RAILS_ENV=test
# create schema
bundle exec rake db:create
# create tables
bundle exec rake db:migrate
# create seed data
bundle exec rake db:seed
# pre-compile js/css assets
bundle exec rake assets:precompile
# run thin server in HTTPS port & in background
thin start -p 3000 -d --ssl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment