Saari Development

This blog is intended to be a log of my (Ali Rizvi's) professional ramblings as a software development engineer. I intend to add logs of my experience with different technologies, software, tech books/articles and related stuff from time to time. My intention is to have an archive for my personal use and public benefit.

Sunday, December 11, 2005

Rails: Working around Tiger (OS X 10.4) ruby mysql problem

I was not happy when I found myself stuck try to run scaffolding for the first time, discovering that my previous attempt to fix preinstalled Tiger ruby and that after installing Xcode 2.2 I don't have ruby.h where fixrubyconfig expects (as per the most famous fix Complete Fix for Ruby on Mac OS X 10.4 Tiger which is also mentioned in Agile Web Development with Rails

I was partly heart broken and partly frustrated and hoped that some mac and ruby 'guru' at the upcoming Seattle.rb Hack Night can help.

But then I had a thought and it worked.

I installed the latest stable version of ruby (1.8.3):
Download from:

shell> tar -zxvf ruby-1.8.3.tar.gz
shell> cd ruby-1.8.3
shell> ./configure
shell> make -j5
shell> sudo make install

This installs the new version of ruby in the /usr/local/bin directory on your powerbook

Now I added the new ruby path to my $PATH using
export PATH=/usr/local/bin:$PATH
this would mean that any time a issue a command it would look in /usr/local/bin before /usr/bin where the old (tiger default version is installed). I have also modified my .profile to have a similar PATH in future.

then I downloaded and installed rubygem again:
Download from:

shell> tar -zxvf rubygems-0.8.11.tgz
shell> cd rubygems-0.8.11
shell> sudo ruby setup.rb

Next I installed rails gem

shell> sudo gem install rails --include-dependencies

Next I installed mysql gem

shell> sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql/

it worked for the first time now giving me a successfully installed message.

Finally I was able to do my scaffolding task as suggested by the book:
from your rails app directory do the following for the existing product table

shell> ruby script/generate scaffold Product Admin

It seems that the on Mac OS X you require a username in your database.yml file (you can't leave it blank otherwise it would default to root) so I had to modify my configuration on last time before seeing the magical command work.


Blogger Avari said...

Every so often a post like Rails: Working around Tiger (OS X 10.4) ruby mysql problem grabs my attention while I'm chasing around for the latest
and greatest info about self improvement tapes . And what a pleasure to read someone who apparently not only knows what they're talking about, but apparently also walks the talk. Thank you Ali . Is there any chance you'll be commenting on self improvement tapes at any stage?

9:08 AM  
Blogger tonyyy said...

Hello Ali, I was searching for some info on make money at home and stumbled across your blog. Even though Rails: Working around Tiger (OS X 10.4) ruby mysql problem was different than what I thought, it was different enough to get my attention. I really don't understand how I got your page while looking for make money at home. Anywho I loved your blog and am very happy I stopped by. Thanks for the interesting read.

12:09 AM  

Post a Comment

<< Home