Ruby on Rails with OS X Tiger
I’ll admit there are already 12 million documents out there claiming to explain this, but for one reason or another I couldn’t get any of them to work as written. Ruby on Rails is undergoing rapid development, and OS X is not sitting still either. Here are the steps I used, which should continue to be relevant since I am installing from source instead of relying on the ruby package that comes with Tiger.
1. Install Xcode Tools
Insert your Mac OS X Install Disc 1. Find the Xcode Tools directory, in there you’ll find XcodeTools.mpkg. Double-click it.
2. Install MySQL.
I installed Mac OS X 10.4 (x86) Standard 4.1.19, you can install whatever you want.
3. Install ruby
sudo make install
4. Fix your PATH.
Add this line to ~/.profile
Close and reopen your terminal window, and make sure it worked by running this:
5. Make sure you have the right version of ruby
ruby 1.8.4 (2005-12-24) [i686-darwin8.6.1]
6. Install Ruby Gems
tar xzf rubygems-0.8.11.tgz
sudo ruby setup.rb
7. Install Rails
sudo gem install rails --include-dependencies
8. Install MySQL drivers
sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql/
Pick this option:
3. mysql 2.7 (ruby)
9. Create a new Rails application
sudo chgrp -R www myapplication/tmp
sudo chmod -R g+w myapplication/tmp
10. Configure Apache:
sudo vi /private/etc/httpd/users/yourusername.conf
Options ExecCGI FollowSymLinks
Allow from all
sudo chmod 755 ~/
sudo apachectl restart
11. Edit /etc/hosts
sudo vi /etc/hosts
Your done! With any luck, you should be able to visit http://myapplication/ with your browser and see the Welcome Aboard message from Rails. Error messages and debugging information will be in ~/Sites/myapplication/log/development.log.
Thanks to Saari Development for this post, which helped me put some of these pieces together.