Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Accessing ActiveRecord::ConnectionAdapters::AbstractAdapter from console raises exception

#4469

This is a new, empty Rails 3 app. My database.yml looks like this:

development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

Accessing ActiveRecord::ConnectionAdapters::AbstractAdapter causes it to autoload abstract_adapter.rb, which in turn requires connection_specification.rb. That file then raises an exception for some reason.

[hongli@Minato rails3.test]$ ./script/rails console
Loading development environment (Rails 3.0.0.beta3)
irb(main):001:0> ActiveRecord::ConnectionAdapters::AbstractAdapter
NameError: undefined local variable or method `establish_connection' for ActiveRecord::Base:Class
        from /Users/hongli/Projects/rails/activerecord/lib/active_record/base.rb:1141:in `method_missing'
        from /Users/hongli/Projects/rails/activerecord/lib/active_record/railtie.rb:49
        from /Users/hongli/Projects/rails/activesupport/lib/active_support/lazy_load_hooks.rb:14:in `instance_eval'
        from /Users/hongli/Projects/rails/activesupport/lib/active_support/lazy_load_hooks.rb:14:in `run_load_hooks'
        from /Users/hongli/Projects/rails/activesupport/lib/active_support/lazy_load_hooks.rb:14:in `each'
        from /Users/hongli/Projects/rails/activesupport/lib/active_support/lazy_load_hooks.rb:14:in `run_load_hooks'
        from /Users/hongli/Projects/rails/activerecord/lib/active_record/base.rb:2250
        from /Users/hongli/Projects/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:2
        from /Users/hongli/Projects/rails/activesupport/lib/active_support/dependencies.rb:209:in `require'
        from /Users/hongli/Projects/rails/activesupport/lib/active_support/dependencies.rb:209:in `require'
        from /Users/hongli/Projects/rails/activesupport/lib/active_support/dependencies.rb:195:in `load_dependency'
        from /Users/hongli/Projects/rails/activesupport/lib/active_support/dependencies.rb:523:in `new_constants_in'
        from /Users/hongli/Projects/rails/activesupport/lib/active_support/dependencies.rb:195:in `load_dependency'
        from /Users/hongli/Projects/rails/activesupport/lib/active_support/dependencies.rb:209:in `require'
        from /Users/hongli/Projects/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:12
        from (irb):1

Reported by Hongli Lai · April 24th, 2010 @ 01:59 PM

State: invalid
Milestone: none
Assigned to: Rohit Arondekar Rohit Arondekar
Importance: Low

Activity

  1. David Trasbo
    David Trasbo

    Just out of curiosity: Why are you doing that?

    July 1st, 2010 @ 08:00 PM

  2. Christian Knappskog
    Christian Knappskog

    I get the same error, the plugin acts_as_tsearch is trigging it when using postgresql

    July 6th, 2010 @ 11:33 PM

  3. Neeraj Singh
    Neeraj Singh
    • Importance changed from to Low

    It's working fine for me with rails edge.

    ree-1.8.7-2010.01 >  ActiveRecord::ConnectionAdapters::AbstractAdapter
     => ActiveRecord::ConnectionAdapters::AbstractAdapter
    

    July 7th, 2010 @ 02:01 AM

  4. David Trasbo
    David Trasbo
    • Assigned user set to Rohit Arondekar

    I've come to the same conclusion as Neeraj, using Rails edge on 1.9.2.

    This can be closed.

    September 12th, 2010 @ 08:22 PM

  5. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to invalid

    Closing ticket for now, if this is still an issue just leave a comment and I'll reopen.

    September 13th, 2010 @ 01:49 AM

  6. Ryan Bigg
    Ryan Bigg
    • Tag cleared.

    Automatic cleanup of spam.

    October 9th, 2010 @ 09:54 PM

  7. Ryan Bigg
    Ryan Bigg

    Automatic cleanup of spam.

    November 8th, 2010 @ 01:54 AM

  8. bingbing