sudo apt-get install build-essential git-core zlib1g-dev libssl-dev libreadline5-dev libcurl4-openssl-dev sudo apt-get update sudo apt-get upgrade
sudo apt-get install mysql-server-5.1 mysql-client-5.1 libmysqlclient-dev zlib1g-dev libmysql-ruby1.8 sudo /etc/init.d/mysql start
cd rm -rf ~/.vim ~/.vimrc git clone git://github.com/jfgomez86/vimfiles.git ~/.vim ln -s ~/.vim/dot_vimrc ~/.vimrc
git clone git://github.com/jfgomez86/Console.git ~/.console ln -s ~/.console/bashrc ~/.bashrc ln -s ~/.console/bash_aliases ~/.bash_aliases ln -s ~/.console/bash_functions ~/.bash_functions ln -s ~/.console/inputrc ~/.inputrc echo "gem: --no-ri --no-rdoc" >> ~/.gemrc
cd /usr/local/src sudo wget http://rubyforge.org/frs/download.php/71096/ruby-enterprise-1.8.7-2010.02.tar.gz sudo tar -xzvf ruby-enterprise-1.8.7-2010.02.tar.gz cd ruby-enterprise-1.8.7-2010.02
sudo ./installer --dont-install-useful-gems
sudo passenger-install-nginx-module
sudo vim /usr/local/conf/nginx.conf
server { listen 80; server_name _; root /home/deploy/youstack/current/public; passenger_enabled on; }
sudo /usr/local/sbin/nginx
#Generate Your App & Repo local$ rails new youstack local$ cd youstack/
local$ git init local$ touch tmp/.gitignore log/.gitignore vendor/.gitignore
.bundle db/.sqlite3 log/.log tmp/**/* .DS_Store .project
local$ git status local$ git add . local$ commit -a
local$ git remote add origin git@github.com:filmprog/youstack.git local$ git push origin master
#Setup Github Deploy Key
local$ ssh rumblebox deploy$ ssh-keygen -t rsa deploy$ cat ~/.ssh/id_rsa.pub
deploy$ git ls-remote git@github.com:filmprog/youstack.git
#Configure Cap, Bundler & DB
#Capistrano
local$ capify .
#1. Copy and paste the deploy.rb from the following gist:
#2. And replace the :application, :password, and :repository values.
#3. Also you'll need to update the IP address for your server.
#Bundler
#1. Add MySQL in the production group.
group :production do gem 'mysql', '2.8.1' end
-
Move SQLite 3 to development/testing group.
-
Run 'bundle install' locally.
local$ bundle install
Database
production: adapter: mysql encoding: utf8 reconnect: false database: youstack_production pool: 5 username: root password: rumbleROCK! socket: /var/run/mysqld/mysqld.sock
Deploy Your App
local$ git status local$ git commit -a -m "adding capistrano, bundler and database configuration" local$ git push
local$ cap deploy:setup local$ cap deploy:check local$ cap deploy
cap> cd /home/deploy/youstack/current/; rake RAILS_ENV=production db:create
sudo aptitude install postgres libpq-dev sudo -u postgres createuser --superuser $USER sudo -u postgres psql
\password $USER