3.14.2010

Installing RoR on Snow Leopard

The short of it: if you're on Mac OS X (Snow Leopard, in my case), the smoothest way to install RoR is through MacPorts. (Read the excellent instructions by Paul Sturgess).

* * *

Having lots of time to waste , I decided to continue studying RoR. Things have changed since I got my hands dirty with RoR. I'm now running Snow Leopard. RoR has kept maturing in the one-plus year that I stopped tinkering with RoR (had to do C# -- don't ask).

Anyway, I reasoned that the installation problems I encountered in Tiger were a result of Apple's outdated installation of MySQL and Apache. This time, I felt that the Snow Leopard team may have been thoughtful enough to resolve the old issues from Tiger days.

So I happily followed the steps outlined in http://rubyonrails.org/. Things worked well. I was able to create a web app in no time (applause) using SQLLite for my database and doing the blog exercise on the the rubyonrails.org website. However, as soon as I tried to shift to MySQL, my headaches started.

I downloaded the latest dmg file of MySQL. I got different errors when I tried to run rake db:create. RoR refused to create the database on MySQL as promised (it worked fine with SQLLite, the database that comes pre-packaged in RoR). The error messages alternated between the inability to create the database and a syntax error on the .yml file.

Googling revealed that the problem was common. Many solutions were proposed. I tried many of them too. Nothing worked. My RoR-guru-friend Kenneth kept bugging me to just use MacPorts. I told him this would be my last resort and gave myself a deadline.

That deadline has passed without any fruitful solution. So I have taken Kenneth's advice and gone on installing MySQL, Ruby, Rails and Gems on MacPorts.

* * *
Errors and solutions:

  • Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' - This probably means that MySQL is not running. Start MySQL by typing this on the command line: 

sudo /opt/local/share/mysql5/mysql/mysql.server start



    Useful links:





    (Thanks to Kenneth D. for helping me out in setting up RoR).

    No comments:

    Post a Comment

    Thank you for commenting! Your comment will be submitted for review and approval. Please return soon!