Thursday, March 26, 2009

Install Ruby on Leopard

Wanna to try out Ruby On Rail long time ago but just dont have time the get it install on my Mac, so tonight is the time. Although Leropard ship with Ruby package, it is not up to dated, and beside it does not has MYSQL C Binding, there are more extra steps need to be perform to get ruby fully function on Leopard. There are already many posts out there show how to configure it. I will summary the main steps here and provides a list of links that i use as a references.
1. Log in as a root
2. Update gem (The one ship in leopard is out of date)
gem update --system
3. Install the latest rails (current 2.2)
gem install rails -v=2.2.2
4. Install MYSQL C binding to improve mysql performance (the tricky one)
=> Use the leopard dvd install xcode tool
=> Run: sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-
mysql-config=/usr/local/mysql/bin/mysql_config
=>Choose option 3: mysql 2.7 (ruby)

=====================
To test Rails,
$ rails demo
$ cd demo
$ ruby script/server
veiw page at: http://localhost:3000

=====================

Ruby Installation

C Binding issue on Leopard

Detail on how to fix the problem

More detail on C Binding

My new web development coding suit

These days I am trying out to use another powerful text editing tool, and just find that Textmate is right to the spot. So far i like it very much. Not only because of it simplicities while powerful but also an eye candy tool for coding.
With combine of Expand Drive, i can mount a remote drive to my local machine and editing remote file right from textmate. To enhance performance due to slight delay by remote access, and nature of textmate of auto refreshing when it refocus, install Remate is the right assist for textmate that would solve the problem.

If interested, try it yourself:
TextMate

Expandrive

Remate 2