Using rails without a database

I want to try writing a rails app, using edge rails, all models of
which will extend ActiveResource. In other words, I don’t need a
database.

How do I configure my app so that rails doesn’t look for an RDBMS and
database? This is a problem for example when I run rake tasts, as rake
attempts to connect to the default DB. I tried commenting out
everything in the database.yml file, but that didn’t work.

Isopaleocopria

I want to try writing a rails app, using edge rails, all models of
which will extend ActiveResource. In other words, I don’t need a
database.

Just use sqlite3, and you won’t have to think about the DB. Rails will
create the file silently for you, and you shouldn’t be bothered by
error messages of any kind (I guess).

Alain


Alain R.

http://blog.ravet.com

I did try this in my environment.rb file:

    config.frameworks -= [:active_record]

This did stop rails from trying to establish a connection to the
database, but it also leads to exceptions, since other gems, like
active support and railties, have dependencies on ActiveRecord.

Isopaleocopria

I did try this in my environment.rb file:
config.frameworks -= [:active_record]
… but it also leads to exceptions, since

Make your life simpler :

file: database.yml

development:
adapter: sqlite3
database: db/development.sqlite3
timeout: 5000
production:
development
test:
adapter: sqlite3
database: db/test.sqlite3
timeout: 5000


Alain R.

http://blog.ravet.com