Setting up Ruby on Rails Database Connection using SQLite (version 2 and 3) on Fedora 7

SQLite is good for development and testing, and depending on your needs production even. By default Typo uses SQLite for production. The greatest advantage is that it’s light. (like duh), and very easy to deploy.

Note: There are two versions of SQLite, version 2 and 3. They produce databases which are incompatible with each other.

Version 2

Enter into the Terminal, and as root execute:
yum install gcc ruby-devel sqlite2-devel
gem install sqlite-ruby

If you see this, you want the ruby version, so select 1 (enter it in).

Select which gem to install for your platform (i486-linux)
 1. sqlite-ruby 2.2.3 (ruby)
 2. sqlite-ruby 2.2.3 (mswin32)
 3. sqlite-ruby 2.2.2 (ruby)
 4. sqlite-ruby 2.2.2 (mswin32)
 5. Skip this gem
 6. Cancel installation
>

Edit the file File RAILS_ROOT/config/database.yml. For now we are using the Database development environment. The environment you are deploying your database should look like so.

development:
  adapter: sqlite
  dbfile: db/development.sql

Version 3

Enter into the Terminal, and as root execute:
yum install gcc ruby-devel sqlite-devel
gem install sqlite3-ruby

If you see this, you want the ruby version, so select 2 (enter it in).

Select which gem to install for your platform (i486-linux)
 1. sqlite3-ruby 1.2.1 (mswin32)
 2. sqlite3-ruby 1.2.1 (ruby)
 3. sqlite3-ruby 1.2.0 (mswin32)
 4. sqlite3-ruby 1.2.0 (ruby)
 5. Skip this gem
 6. Cancel installation
>

Edit the file File RAILS_ROOT/config/database.yml. For now we are using the Database development environment. The environment you are deploying your database should look like so.

development:
  adapter: sqlite3
  dbfile: db/development.sql

Conclusion

There you have it, your database is now set up!

1 Comment »

  1. Kaizenlog » Blog Archive » Database 11/06/2007 said,

    June 12, 2007 @ 12:41 am

    […] Setting up Ruby on Rails Database Connection using SQLite (version … By aizatto Edit the file RAILS_ROOT/config/database.yml . For now we are using the development environment. The environment you are deploying your database should look like so. development: adapter: sqlite dbfile: db/development.sql … rails symphonies - http://rails.aizatto.com […]

RSS feed for comments on this post · TrackBack URI

Leave a Comment