|
Abbey Workshop |
||||||||||
Because of the great difficulty I have had getting MySQL to work with Rails on Mac OS X, I decided I would use SQLite instead. In addition, with MySQL's new dual license, I would prefer to use something that has no strings attached. SQLite is a simple file based database system that requires no network. In addition, the source and the binaries are distributed in the public domain. This means you can pretty much do whatever you want with the database and distribute and embed it to your heart's content.
While trying to figure out how to use SQLite with Rails, I ran across this website: How to use SQLite in Ruby on Rails. For my money, this is the most concise, to the point, and accurate site on the subject I could find. I know have Rails working with SQLite on OS X, Ubuntu Linux, and Windows XP. Woot!
First I have to say, getting Ruby on Rails to work on Ubunutu Linux has been a pretty hellish experience. Well, getting Ruby on Rails to work on anything has been a pretty hellish experience. But now, I have conquered the beast and can more or less follow along in the Ruby on Rails Agile programming book. Woot!
To prevent some other poor programmer from having the same fun experience I thought I would share what I have learned. The steps below are for installing Ruby, Rails, and SQLite3. I am planning to use SQLite three because of the simplicity and freedom it provides compared to other database products.
Do all the following commands using sudo or as root. I just use sudo bash and execute them consecutively.
First, Ruby is not installed on Ubuntu by default. So here are the steps to get everything. You need the dev package and rdoc to have everything in place for rails.
The dev package from above is required to install gems. Otherwise you will be missing some header files. To install gems:
Install all the sqlite3 debian packages.
Install the ruby sqlite debian packages.
Now that all the packages are in place, you can install rails using Ruby gems.
gem install rails
That should do the trick. Enjoy.
Copyright © Abbey Workshop 2005