Rails: SQLite Replaces MySQL as Default Database

If you’ve waited until now before upgrading to Ruby on Rails 2.0 now you may be in for a little surprise.  As of version 2.02 the default database in Rails is SQLite, arguably because there is no need to for grants or the creation of tables, meaning a simpler setup for n00bs.  If you still want to use MySQL (or any other database for that matter) you have to provide the following:

rails -d mysql appname

SQLite3 and the necessary driver gems come preinstalled on OS X Leopard, but if you don’t have the Ruby bindings installed it’s as simple as:

sudo gem install sqlite3-ruby

You can always change which db your Rails app is using by changing your config/database.yml.

Chris Lamothe is a software developer flourishing in Banff, Canada.

Posted in Development

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>