Practical eCommerce

 

Rails 2.0.2 Defaults to SQLite3

Author: Brian Getting
Publish Date: December 31, 2007
Blog: Developers' Corner
Tags: ruby, rails, mysql

avatar

As some of you may have noticed since updated your Rails gems to the new 2.0.2 version, there have been some changes to the defaults. The primary one that will stare many people in the face is that rather than defaulting to MySQL as the database application that Rails uses, it now wants to default to using SQLite3. The Rails core team sums up their decision in this post on the Rails blog, which seems to make sense. After all, being opinionated is what Rails is all about.

However, I still use MySQL, and will probably continue to for a while. I know quite a few people that will also probably continue to use MySQL, which means that when we are generating a new Rails application we will need to start telling Rails that we want to change the database application. This is simple enough, as creating a new application is simply a matter of typing this following into the terminal:

rails applicationName

Of course, this will default to SQLite3, so in order to have Rails generate a new application that will interface with MySQL, we simply add a flag to our command, resulting in:

rails -d mysql applicationName

This will generate a new application that uses the MySQL adapter, just like the default used to be. There are quite a few other changes, so I recommend checking out the Rails blog in order to get caught up. Specifically, there is another new default that will not look for updated templates in production mode. Rather, it will cache views in production mode, meaning that when you change templates on the production server you will also need to restart the application server (Mongrel in most cases) in order for Rails to register the changes.

Add a Bookmark: Add 'Rails 2.0.2 Defaults to SQLite3' to Del.icio.us Digg 'Rails 2.0.2 Defaults to SQLite3' on Digg.com Submit 'Rails 2.0.2 Defaults to SQLite3' to reddit.com Blink 'Rails 2.0.2 Defaults to SQLite3' Add 'Rails 2.0.2 Defaults to SQLite3' to dzone Seed 'Rails 2.0.2 Defaults to SQLite3' on Newsvine Add 'Rails 2.0.2 Defaults to SQLite3' to Furl Add 'Rails 2.0.2 Defaults to SQLite3' to Spurl Add 'Rails 2.0.2 Defaults to SQLite3' on simpy.com Add 'Rails 2.0.2 Defaults to SQLite3' to fark.com BlogMark 'Rails 2.0.2 Defaults to SQLite3' Add 'Rails 2.0.2 Defaults to SQLite3' to Yahoo! myweb2 Add 'Rails 2.0.2 Defaults to SQLite3' to wists.com Stumble It!

0 Comments

Sign-up to receive EcommerceNotes, our acclaimed email newsletter.

View A Sample | Privacy

Bloggers Wanted

We’re looking for merchants and other ecommerce professionals to share their experiences with our readers. If this interests you, we invite you to contact us.

Inside Practical eCommerce