Skip to content

Instantly share code, notes, and snippets.

@robinator
Created September 25, 2013 15:40
Show Gist options
  • Save robinator/6701544 to your computer and use it in GitHub Desktop.
Save robinator/6701544 to your computer and use it in GitHub Desktop.
Script / commands to setup a rails / mysql ubuntu server.
apt-get update
apt-get install build-essential openssl libreadline6 libreadline6-dev curl libcurl4-openssl-dev git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config memcached libsasl2-dev gettext mysql-client libmysqlclient-dev imagemagick libmagickwand-dev
# http://aws.amazon.com/articles/1233
# 0) Add deploy user and make sudoer
adduser deploy admin
passwd deploy
# 1) First install rvm system-wide
# https://rvm.beginrescueend.com/rvm/install/
curl -L https://get.rvm.io | sudo bash -s stable
source /etc/profile.d/rvm.sh
# 2) Tell the shells where to find rvm
# add below to ~/.bash_profile at bottom (for both root and deploy)
[[ -s '/usr/local/lib/rvm' ]] && source '/usr/local/lib/rvm'
# 3) We don't want ri or rdoc for our gems...
# add below to ~/.gemrc at bottom (for both root and deploy)
install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
# 4) add deploy to the rvm group
usermod -a -G rvm deploy
# 5) Install your ruby, bundler, and passenger
rvm pkg install zlib
rvm install iconv
gem install bundler
gem install passenger
passenger-install-nginx-module
# 6) Add these lines to the top of your config/deploy.rb file if you're using bundler
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require "rvm/capistrano" # Load RVM's capistrano plugin.
set :rvm_ruby_string, 'default' # Or whatever env you want it to run in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment