We are in the midst of a full fledge project and the immediacy in which we implement is the onlye sense of urgency consuming my life as of late.
However, It makes sense, it's what is needed and what is desired. After all, we're in this field, to well, a monetize.
Afterall, we have to put the chicken in the pot, gas in the tank and keep the electric on in order to compute and do it all over again, well tomorrow. Seems like a cyclic tube-life, no?
So let's start with the quick procedure to install
RUBY ON RAILS in OSX. I use
POSTGRESQL and since
MYSQL is the
RUBY ON RAILS default of choice I will show the
POSTGRESQL install. If your interested in
MYSQL You can follow the instructions below and ignore the
POSTGRESQL and the
MYSQL install should behave correctly.
Part One:
- If you have OSx 10.4 Ruby is installed.
- If your going to install and compile Ruby than it has issues that are addressed in this document
- Realize that things like this happen
Part Two:
- Let's start with the version to install: I am using MAC OS 10.4.7
- Apple's "Developer Tools", Xcode needs to be update to ersion 2.0 or newer. The default installation is will not suffice.
- If you use curl or fink you can skip this step. If not you must install readline in order install readline through fink try these instructions. Then issue the following command:
- sudo /sw/bin/fink install readline
- Curls method follows
-
sudo curl -O ftp://ftp.gnu.org/gnu/readline/readline-5.1.tar.gz
tar xzvf readline-5.1.tar.gz
cd readline-5.1
./configure --prefix=/usr/local
make
sudo make install
cd ..
- Ruby is installed on MAC OS X but it may not be the NEWEST version. Let's check it at the terminal.
- ruby -v
ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0]
As you can see the version is 1.8.2 so let's upgrade the ruby installation. - sudo curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.4.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4211k 100 4211k 0 0 236k 0 0:00:17 0:00:17 --:--:-- 293k
Let's check what version ruby is at after the final installation:
First : Insure your path is set so /usr/local/bin comes first in your path.
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
Then issue
$ ruby -v
ruby 1.8.4 (2005-12-24) [powerpc-darwin8.7.0] Now we are ready for the gems installation
$ curl -O http://rubyforge.iasi.roedu.net/files/rubygems/rubygems-0.9.0.tgz
$ tar xzvf rubygems-0.9.0.tgz
$ cd rubygems-0.9.0
$ sudo /usr/local/bin/ruby setup.rb
$ cd ..
"Measure twice cut once"
Let's check the gem installation :
$ gem -v
0.9.0
Next we'll install rails:
$ sudo gem install rails --include-dependencies
There you have it... Quick, Clean and to the point.
Now, the tutorials out there are plentiful and many are written about the Ruby WebBrick server. We are in the middle of using the Ruby-FCGI for FAST CGI.
Once we have a solid production hardened version ill publish the steps to install this is just a quick attempt of documenting the initial installation.
This is the broken part! Let's fix it!
Apple shipped Tiger with a couple of problems, in short the solution is below: [GOOD NEWS IS LEOPARD WILL SHIP WITH RAILS & This problem will vanish]
sudo gem install fixrbconfig; sudo fixrbconfig
The Postgresql is quite simple for MAC OS X the procedure follows:
- Install Postgresql the MAC OS X is extremly easy and is described here
- With the gem utility installaed above iseeu the following command
This postgres-pr is the defacto-standard for the RUBY driver. There is another but for now this is the quickest to market for our purposes.
Ruby On Rails configuration in the tutorials will describe the configuration of the database via database.yaml (YAML = Yet Another Markup Langauge).
REMEMBER THIS WHEN SETTING UP POSTGRES IN THE DATABASE YAML FILE "
database.yaml". The adapter to reference the
postgresql NOT postgres-pr!!!
The proper reference is an excerpt for the development data base configuration:
development:
adapter: postgresql
database: mydatabase
username: postgres
password: 44$44
host: localhost
That's about it.. This should get you up and running in no time!!
tags: ruby rails op os x open source mysql postgresql ruby on rails
links: digg this del.icio.us technorati reddit