Lately I started experimenting with Ruby on Rails. I found it was very difficult to get RoR work with mySQL since RoR is using SQLite instead. I went through some a couple of dreadful tutorials but could not get it working. Then I finally found out a way from a friend. So this tutorial will show you how to easily install and get MySQL to work with RoR on Mac OS leopard.
1. install MacPorts
Go through the installation wizard once you have downloaded it.
2. Run this code in terminal
sudo port install rb-mysql
3. Possible Error
You might get an error
port command not found
No worries. Just run this three lines in terminal.
export PATH=$PATH:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info
Finally, sit back and wait until everything is fully installed. Be patient!
It will automatically install
- Rails 2.3.5
- ruby 1.8.6
- gem 1.3.5
- Mysql(5.1)