Got Ruby on Rails and Tracks working

Tracks screenshot

Tracks screenshot,
originally uploaded by msabramo.

It took a while to get it working, but I finally managed to install Ruby on Rails and then Tracks, a RoR web application for GtD on my PowerBook.

Some hints for getting it working on Tiger:

  • I used a MySQL 4.1 installer from here – my version is mysql Ver 14.7 Distrib 4.1.10, for apple-darwin8.2.0 (powerpc)
  • I used the Ruby on Rails for Tiger installer at this page. I also needed to follow the instructions at the bottom of the page to install the “mysql” gem, which is not part of the aforementioned RoR installer. Specifically, I did:
    sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
    

    Note that if you don’t supply --with-mysql-dir, the install of the mysql gem is likely to fail with ERROR: While executing gem … (RuntimeError) ERROR: Failed to build gem native extension. That’s what happened to me at least on Mac OS X Tiger. Interestingly, I was able to install the mysql gem without that option on a FreeBSD server – I don’t know why.

  • I used ruby-1.8.2 (comes with Tiger), rails-0.13.1, redcloth-3.0.3, and mysql-2.6. Use the gem list command to see what you have and sudo gem update to update.
  • I used Tracks 1.03, which I got from here. I unzipped the file in $HOME/Sites
  • I followed the Tracks install instructions in doc/README_FOR_APP for copying the config/{database,settings}.yml.tmpl files to config/{database,settings}.yml, creating a “tracks” database in mysql and populating it with data using the sql scripts in the db directory.
  • I fired up the WEBrick server by running this from the “tracks” root directory: ruby script/server --environment=production
  • Then I went to http://0.0.0.0:3000/signup and created my account and now tracks is available at http://0.0.0.0:3000/ — this is with WEBrick — I haven’t attempted to mess with Apache and FastCGI yet. I’ll save that for another day.

2 thoughts on “Got Ruby on Rails and Tracks working

  1. Glad you managed to get it installed! MySQL can be a bit of a beast to get running. Remember that on Tiger you have the option of using SQLite3 databases, which is much easier: small, fast, portable, and you don’t need to start a daemon to get the database running.

Leave a Reply

Your email address will not be published. Required fields are marked *