Created
September 25, 2013 15:40
-
-
Save robinator/6701544 to your computer and use it in GitHub Desktop.
Script / commands to setup a rails / mysql ubuntu server.
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
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