Categorized: Database, Rails

Using SQLite with Rails

After watching the RESTful Rails PeepCode presentation, I had to try using SQLite for development. That’s nice to not have to set up a database for every little thing you want to play with.

SQLite 3 is already installed on OS X. To get it to work with Rails:

$ sudo port install swig
$ sudo gem install sqlite3-ruby

That will bring up a prompt to choose a gem. Choose the highest version number that says (ruby) after it.

Then you can do things like this in your database.yml:

development:
  adapter: sqlite3
  database: db/development.sqlite3

Source: Rails wiki

Comments

[...] See also how to set up SQLite for Rails [...]

Rake Tasks for dumping mysql at Ivan Enviroman → February 20th, 2008 at 9:50 am

[...] have definitely used sqlite database files but I also like sticking to mysql, because I know that’s what I’ll use [...]

What do you think about that?

Elsewhere in the empire: Home, Blog, APOD