views:

45

answers:

1

Hi,

I'm trying to use rails 3 without any db backend, but it still insists on requiring 'sqlite3' gem when I try to access a page, and throws an error no such file to load -- sqlite3, even though no code in the application requires sqlite, except I left database.yml with its default setting for sqlite3, since removing the content raised other errors. Any idea how I could use rails without any database and avoid said errors? thanks.

(also, I'm familiar with Sinatra - just prefer rails for this project).

+2  A: 

Rails 3:

In application.rb, remove the require 'rails/all' line and instead add these lines:

require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "rails/test_unit/railtie"

Also see http://stackoverflow.com/questions/2212709/remove-activerecord-in-rails-3-beta and look into the Active Model railscast

Rails 2.x:

In config/environment.rb add (or uncomment) the line

config.frameworks -= [ :active_record, :active_resource, :action_mailer ]

This will cause Rails not to use those frameworks. (Note the nearly-invisible -= !)

Zabba
I think this works in rails 2.x - I get a deprecation message and an error in r3.
sa125
Updated the answer with the method used in Rails 3
Zabba
that did it - thanks!
sa125