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).
Rails 3:
In
application.rb
, remove therequire 'rails/all'
line and instead add these lines:Also see Remove ActiveRecord in Rails 3 and look into the Active Model railscast
Rails 3.2.x:
You'll also need to remove/comment out this line in application.rb
And remove/comment these two lines from development.rb
Rails 2.x:
In
config/environment.rb
add (or uncomment) the lineThis will cause Rails not to use those frameworks. (Note the nearly-invisible
-=
!)Also, in Rails 3, remove any references to active_record in
config/environments/development.rb
config/environments/test.rb and
config/environments/production.rb such as
as well as removing require "rails/all" and adding the require lines in comment 21 (above).
if you are not using a database (this works with Rails 3.1.1)