Sunday, August 26, 2007

Rails stack on Mac OS X and Ubuntu 6.06

Been researching and practicing with Rails for a little while now, and went through the process of updating my setup on my Mac book pro (Mac OS X), as well as on an Ubuntu (Dapper, 6.06) test machine (actually a test VM).

Most of this is similar to what you would find inside of "Agile Web Development with Rails" by the esteemed DHH and Dave Thomas (by the way, if you're interested in Rails development, imho, it's the best book around by far -- very comprehensive and a smooth read). It is also similar to this post by James Duncan Davidson.

So why am I posting this here? Well because in order for me to get it to work on both my Mac and on Ubuntu 6.06, I had to tweak the instructions slightly for a variety of reasons (some version upgrades, etc).

Posting this on my blog not only to share, but for my own future reference. So here goes, for both Mac OS X and Ubuntu Dapper Drake 6.06, a line by line installs of a Rails stack: Apache 2.2, mySQL5 database server, SVN, Ruby 1.8.4, Ruby Gems, Ruby Termios Library, Mongrel, Mongrel Cluster, Capistrano 2.0.

For Mac OS X on Mac Book Pro (Intel-based Mac):

# first you need to download and install DarwinPorts (now known as MacPorts) 1.5.2:
http://darwinports.com/

# once you have MacPorts installed, you may commence with the Rails stack install...
$ sudo port install apache2
$ sudo port install mysql5 +server
$ sudo port install subversion +tools
$ sudo port install ruby
$ sudo port install rb-rubygems
$ sudo port install rb-termios
$ sudo gem install -y rake
$ sudo gem install -y rails
$ sudo gem install -y capistrano
$ sudo gem install -y mongrel
$ sudo gem install -y mongrel_cluster
For Ubuntu 6.06 VM on Mac Book Pro (Intel-based Mac):
$ sudo apt-get install apache2
$ sudo apt-get install mysql-server
$ sudo apt-get install openssl libssl-dev
$ sudo apt-get install libdb4.3 libdb4.3-dev db4.3-util libdb4.3++c2 libdb4.3++-dev
$ wget http://www.shiftingheat.com/packages/subversion/subversion_1.4.0-1_i386.deb
$ sudo dpkg -i subversion_1.4.0-1_i386.deb # install ruby gems from source:
$ sudo apt-get install ruby
$ wget http://rubyforge.org/frs/download.php/17190/rubygems-0.9.2.tgz
$ tar xzvf rubygems-0.9.2.tgz
$ cd rubygems-0.9.2
$ sudo ruby setup.rb
$ sudo gem update --system

# now install 'build-essential' before installing gems:
# Compilers (and manual pages [optional])
$ sudo apt-get install build-essential manpages-dev
$ sudo apt-get install ruby1.8-dev

# now install the following RubyGems: Rake, Rails, Capistrano, Mongrel, Mongrel_cluster...:
$ sudo gem install --include-dependencies rake
$ sudo gem install --include-dependencies rails
$ sudo gem install --include-dependencies termios
$ sudo gem install --include-dependencies capistrano
$ sudo gem install --include-dependencies mongrel
# selected: 2. mongrel 1.01 (ruby), 1. fastthread 1.0 (ruby)
$ sudo gem install --include-dependencies mongrel_cluster
I will try and make a follow up post on Configuring Mongrel and Deploying with Capistrano 2.0, and connecting Apache to Mongrel, installing MemCacheD... but this at least gets the Rails stack installed with gems.

Hope this saves you some time in your Rails development-

1 comment:

dev said...

Gr8 work...thanks...next post plz!!