Get your Rails app deployed in 30 mins or less
ENTER THE REQUIRED INFO:
Enter in a few details, install location, ip address etc. None of the details will be stored in anyway. If you’ve ruby already installed, the script will warn you and ask for your confirmation before you continue. Its highly recommened you use this script on clean installations only. We take NO responsibility for any data loss or breakage.
Welcome to EzRor. Please enter your License Key:
Please enter the folder location of your new app:
Please enter the domain to setup rails on:
Please enter the IP of the domain to setup rails on:
Please enter the Rails project name:
Please enter the root password:
$ pwd (Your password will not be stored)
Please enter the MYSQL database name to create:
Do you want to use Github to deploy (y/n)?:
Please enter your GIT username:
Please enter your GIT email:
$ [email protected]
Please enter your GitHub Project Repo name:
If you have uploaded Rails files to server, what
location are they under? (Enter to Skip):
FIRST WE MAKE SURE THE SYSTEM IS UPDATE:
This is the longest process of the installation. Depending on your internet connection, it may take anywhere from 10-20 minutes.
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirror.steadfast.net
* base: updates.interworx.info
* extras: mirror.ash.fastserv.com
* updates: centos.mirror.nac.net
Setting up Install Process
NEXT WE INSTALL RUBY ENTERPRISE:
Ruby Enterprise Edition has much better performance than regular ruby. (According to phusion passenger about 33% less). REE also install number of other things such as Rubygems, rake, fastthread, passenger etc.
Installing Ruby, Ruby Gems, Passenger, and Rails
Welcome to the Ruby Enterprise Edition installer
This installer will help you install
Ruby Enterprise Edition 1.8.7-2010.02.
Don't worry, none of your system files will be
touched if you don't want them
to, so there is no risk that things will screw up.
Auto-installing to: /opt/ruby-enterprise
Compiling and optimizing the memory allocator for
Ruby Enterprise Edition
In the mean time, feel free to grab a cup of coffee.
./configure --prefix=/opt/ruby-enterprise --disable-
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a BSD-compatible install...
checking whether build environment is sane... yes
checking for gawk... gawk
NEXT WE INSTALL SQLITE 126.96.36.199:
sqlite3-ruby gem requires additional packages for it to work properly.
Resolving www.sqlite.org... 188.8.131.52
Connecting to www.sqlite.org|184.108.40.206|:80.
HTTP request sent, awaiting response... 200 OK
Length: 1486971 (1.4M) [application/x-gzip]
Saving to: `sqlite-amalgamation-220.127.116.11.tar.gz'
100%[================>] 1,486,971 1.98M/s in 0.7s
2010-10-10 07:56:18 (1.98 MB/s) -
AFTER THAT COMES APACHE-2:
First we’ll need to exclude a line in /etc/yum.confg so we can the apache-2 from repos
Compiling and installing Apache 2 module...
/opt/ruby-enterprise/bin/ruby -S /opt/ruby-enterprise/
bin/rake clean apache2
# /opt/ruby-enterprise/bin/ruby -S /opt/ruby-enterprise/
bin/rake clean apache2
rm -rf ext/apache2/libboost_oxt.a ext/apache2/libboost_oxt
rm -rf ext/apache2/libpassenger_common.a ext/apache2/
NEXT WE INSTALL PASSENGER 2.2.15:
We’ll be deploying your app through phusion passenger, so we’ll need to install that first. Passenger has numerous dependencies, which were taken care of in previous steps.
Welcome to Phusion Passenger v2.2.15.
This installer will guide you through the entire
installation process. It
shouldn't take more than 3 minutes in total.
Checking for required software...
* GNU C++ compiler... found at /usr/bin/g++
* Ruby development headers... found
* OpenSSL support for Ruby... found
* RubyGems... found
* Rake... found at /opt/ruby-enterprise/bin/rake
* rack... found
* Apache 2... found at /usr/sbin/httpd
NEXT CREATE SYMLINKS:
Ruby enterprise edition installs in a different location than regular ruby and hence so does gems. For the gem executables to work properly, we’ll create symlinks.
ln: creating symbolic link `/usr/bin/ruby' to
ln: creating symbolic link `/usr/bin/rake' to
ln: creating symbolic link `/usr/bin/gem' to
ln: creating symbolic link `/usr/bin/rails' to
THEN WE CONFIGURE PASSENGER:
Passenger requires we add couple lines, which load passenger, to /etc/httpd/conf/httpd.conf. We do that by creating a local file and including that into the master apache file. This file also contains info about your apps’ ip address and location.
LoadModule passenger_module /opt/ruby-enterprise/
NEXT UP GITHUB (OPTIONAL):
We also provide GITHUB deploy option. This step only runs if you specify it in the beginning. To configure GITHUB we need to specify out id_rsa.pub key. You will be emailed detailed instructions on how to do that.
Please follow the following instructions to use
Github to deploy your app on your server:
Login to your Github account
Click "Account settings" (Upper right side)
Click "SSH Public keys" (Lower left side):
Click "Add Another Public Key"
Copy and paste the key below
Be sure to copy the key exactly
Click "Add Key"
You're all done.
AND FINALLY WE CONFIGURE CAPISTRANO:
This is the final step in the process. We’ll be using a very simple capistrano recipe. You’re free to change it to suit your purpose. The file is under /config/deploy.rb in your application folder.
[add] writing './Capfile'
[add] writing './config/deploy.rb'
default_run_options[:pty] = true
# be sure to change these
set :user, 'root'
set :domain, 'domain'
set :application, 'app'
set :repository, '/home/app/.git'
set :deploy_to, "/home"
set :deploy_via, :remote_cache
set :scm, 'git'
set :branch, 'master'
HOORAY, WE’RE DONE’:
If the above process was successful, you should see something like this:
RUBY - INSTALLED
RAILS - INSTALLED
GIT - INSTALLED
RUBY GEMS - INSTALLED
PASSENGER - INSTALLED
If you run into any trouble, email us.