I’ve written a RESTful web service using Rails 1.2 and now I’m trying
to upgrade to Rails 2.0, but it seems to insist that I have a database
configured. Previously I had the following code in
config/environment.rb and that seemed to be sufficient:
class << ActiveRecord::Base
def establish_connection(spec = nil)
After the upgrade, running rake test:units results in a
ActiveRecord::ConnectionNotEstablished because the abstract connection
adapter in AR was trying to retrieve the current database connection.
So overriding establish_connection no longer appears to work in Rails
Then I saw that adding this to environment.rb would apparently do the
config.frameworks -= [ :active_record ]
But alas, doing that causes missing dependencies for active_support
and other plugins, so that won’t work either.
Aside from biting the bullet and using sqlite, is there a way to
configure Rails 2 so that it will not use a database?