We completed setting up ssh and ssh keys in part one, let's continue now with part two of installing a full Rails stack.
SSH into your server:
-
ssh -p 8888 deploy@your_linux_box.com
By default, Debian and Ubuntu have five package repositories called main, restricted, universe, multiverse, and commercial. You will need the universe package repository. By default, it may or may not be enabled. To check, edit the /etc/apt/sources.list file (note that if you didn't install the aliases in part one you'll use "sudo nano" instead of sn below):
-
sn /etc/apt/sources.list
Uncomment the following two lines (assuming Ubuntu Feisty is installed):
-
deb http://us.archive.ubuntu.com/ubuntu/ feisty universe
-
deb-src http://us.archive.ubuntu.com/ubuntu/ feisty universe
Save and exit nano.
Now, lets make sure our server packages are up to date (note that in all of the installs for our Rails stack if you are prompted with "yes/no" say yes:
-
sudo apt-get update
-
sudo apt-get upgrade
Install the GCC Tool Chain:
-
sudo apt-get install build-essential
Now lets create a src directory to build from and get ruby and friends setup:
-
cd ~/
-
mkdir src
-
cd src
-
wget ftp://ftp.gnu.org/gnu/readline/readline-5.2.tar.gz
-
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6.tar.gz
-
tar zxvf ruby-1.8.6.tar.gz
-
tar zxvf readline-5.2.tar.gz
-
cd readline-5.2
-
./configure
-
make
-
sudo make install
-
cd ../ruby-1.8.6
-
sudo apt-get build-dep ruby1.8
-
./configure
-
make
-
sudo make install
Install other core packages:
-
sudo apt-get install ri rdoc irb ri1.8 ruby1.8-dev libzlib-ruby zlib1g
Install RubyGems:
-
cd ..
-
wget http://rubyforge.org/frs/download.php/20989/rubygems-0.9.4.tgz
-
tar xvzf rubygems-0.9.4.tgz
-
cd rubygems-0.9.4
-
sudo ruby setup.rb
Install Ruby on Rails and Dependencies (the following will download the latest framework):
-
sudo gem install rails --include-dependencies --no-rdoc --no-ri
If you need a specific version of rails here is an example which gets version 1.2.5:
-
sudo gem install rails -v 1.2.5 --include-dependencies --no-rdoc --no-ri
Now let's install Mongrel (make sure you select the top ruby option when prompted):
-
sudo gem install mongrel mongrel_cluster --include-dependencies --no-rdoc --no-ri
Now we need to install some packages in preparation for Nginx:
-
sudo apt-get install libpcre3-dev libpcre3 libpcrecpp0 openssl libssl-dev
Grab the latest build of Nginx:
-
cd ~/src
-
wget http://sysoev.ru/nginx/nginx-0.5.35.tar.gz
-
tar xzvf nginx-0.5.35.tar.gz
-
cd nginx-0.5.35
-
./configure --sbin-path=/usr/local/sbin --with-http_ssl_module
-
make
-
sudo make install
Check that nginx is working and in your $PATH. The version command option should do the trick:
-
nginx -v
-
nginx version: nginx/0.5.35
That's it for today. Next time we will setup the Nginx configuration files for our website and continue to add new functionality to our stack.
Tags: Rails, ruby on rails, setup, subversion







3 comments so far
Leave a reply