[Rails] Database Adapters Not Found

Curt Sampson cjs at cynic.net
Thu Nov 11 16:06:49 GMT 2004


I've just done a quick non-gems install of 0.8.0, running over
ruby-1.8.2 (2004-07-29). Unfortunately, I can't seem to create a new
controller.

The first issue was that it seems that this version requires you have
all of the database drivers (MySQL, PostgreSQL and SQLite) installed.
In vendor/activerecord/lib/active_record.rb:

    require 'active_record/connection_adapters/mysql_adapter'
    require 'active_record/connection_adapters/postgresql_adapter'
    require 'active_record/connection_adapters/sqlite_adapter'

The sqlite adapter attempts to use gems to grab the sqlite library it
needs if it can't require it in the normal way (an issue that has been
mentioned before on this list, though I couldn't find a resolution for
it), which I solved for the moment by commenting out that last line. (I
have PostgreSQL and MySQL drivers installed.)

For developers: just remember, there are people out there with very good
reasons not to use gems. For my application I build my open apache,
mod_ruby, all non-standard ruby libs, and many other things because I
need to run on machines with all sorts of random stuff installed that I
can't control.

Anyway, after that:

dev1 $ ./script/new_controller
./script/../config/environments/../../vendor/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:66:in `establish_connection': ActiveRecord::AdapterNotFound (ActiveRecord::AdapterNotFound)
    from ./script/../config/environments/production.rb:6
    from ./script/new_controller:3:in `require'
    from ./script/new_controller:3

The adapter_method is "postgresql_connection", which seems right since
I set the config/database.yml to use postgresql. self of course is
ActiveRecord::Base, which doesn't have this method. What's gone wrong?

cjs
-- 
Curt Sampson  <cjs at cynic.net>   +81 90 7737 2974   http://www.NetBSD.org
     Make up enjoying your city life...produced by BIC CAMERA


More information about the Rails mailing list