Not really Camping specific, but I''ve always had better luck asking on this list than any of the rails ones. I''m trying to upgrade from activerecord 2.3.8 to 3.0.7 and I''m getting a ActiveRecord::ConnectionNotEstablished error when the has_and_belongs_to_many association is being used. A simple example is attached, and the stack follows. Has anyone run into this before? !! Error loading /var/www/apps/arg/arg.rb: ActiveRecord::ConnectionNotEstablished: ActiveRecord::ConnectionNotEstablished /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:317:in `retrieve_connection'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in `retrieve_connection'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/associations.rb:1806:in `create_has_and_belongs_to_many_reflection'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/associations.rb:1411:in `has_and_belongs_to_many'' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/autosave_association.rb:137:in `has_and_belongs_to_many'' /var/www/apps/arg/arg.rb:16:in `<class:Assembly>'' /var/www/apps/arg/arg.rb:15:in `<module:Models>'' /var/www/apps/arg/arg.rb:14:in `<top (required)>'' /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:60:in `load'' /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:60:in `load_apps'' /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:105:in `reload!'' /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:180:in `block in reload!'' /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:179:in `each'' /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:179:in `reload!'' /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:158:in `update'' /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/server.rb:157:in `find_scripts'' /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/server.rb:161:in `reload!'' /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/server.rb:169:in `call'' /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/lint.rb:48:in `_call'' /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/lint.rb:36:in `call'' /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/showexceptions.rb:24:in `call'' /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/commonlogger.rb:18:in `call'' /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/server.rb:242:in `call'' /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/content_length.rb:13:in `call'' /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/handler/webrick.rb:52:in `service'' /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'' /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'' /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'' !! Error loading /var/www/apps/arg/arg.rb, see backtrace above 127.0.0.1 - - [24/May/2011 13:45:00] "GET / HTTP/1.1" 404 45 0.9436 -- Dave -------------- next part -------------- A non-text attachment was scrubbed... Name: arg.rb Type: application/octet-stream Size: 1072 bytes Desc: not available URL: <http://rubyforge.org/pipermail/camping-list/attachments/20110524/e25cfdfe/attachment.obj>
It seems that you need to establish a connection *before* you write your models. Doesn''t seem to be a way around it :/ // Magnus Holm On Tue, May 24, 2011 at 19:53, David Susco <dsusco at gmail.com> wrote:> Not really Camping specific, but I''ve always had better luck asking on > this list than any of the rails ones. I''m trying to upgrade from > activerecord 2.3.8 to 3.0.7 and I''m getting a > ActiveRecord::ConnectionNotEstablished error when the > has_and_belongs_to_many association is being used. > > A simple example is attached, and the stack follows. Has anyone run > into this before? > > !! Error loading /var/www/apps/arg/arg.rb: > ActiveRecord::ConnectionNotEstablished: ActiveRecord::ConnectionNotEstablished > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:317:in > `retrieve_connection'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in > `retrieve_connection'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in > `connection'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/associations.rb:1806:in > `create_has_and_belongs_to_many_reflection'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/associations.rb:1411:in > `has_and_belongs_to_many'' > /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/autosave_association.rb:137:in > `has_and_belongs_to_many'' > /var/www/apps/arg/arg.rb:16:in `<class:Assembly>'' > /var/www/apps/arg/arg.rb:15:in `<module:Models>'' > /var/www/apps/arg/arg.rb:14:in `<top (required)>'' > /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:60:in > `load'' > /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:60:in > `load_apps'' > /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:105:in > `reload!'' > /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:180:in > `block in reload!'' > /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:179:in > `each'' > /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:179:in > `reload!'' > /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:158:in > `update'' > /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/server.rb:157:in > `find_scripts'' > /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/server.rb:161:in > `reload!'' > /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/server.rb:169:in > `call'' > /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/lint.rb:48:in `_call'' > /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/lint.rb:36:in `call'' > /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/showexceptions.rb:24:in > `call'' > /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/commonlogger.rb:18:in > `call'' > /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/server.rb:242:in > `call'' > /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/content_length.rb:13:in > `call'' > /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/handler/webrick.rb:52:in > `service'' > /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'' > /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'' > /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'' > !! Error loading /var/www/apps/arg/arg.rb, see backtrace above > 127.0.0.1 - - [24/May/2011 13:45:00] "GET / HTTP/1.1" 404 45 0.9436 > > -- > Dave > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
It''s likely trying to get the columns or something like that and doesn''t have a connection to do so. --Jeremy On Tue, May 24, 2011 at 2:21 PM, Magnus Holm <judofyr at gmail.com> wrote:> It seems that you need to establish a connection *before* you write > your models. Doesn''t seem to be a way around it :/ > > // Magnus Holm > > On Tue, May 24, 2011 at 19:53, David Susco <dsusco at gmail.com> wrote: >> Not really Camping specific, but I''ve always had better luck asking on >> this list than any of the rails ones. I''m trying to upgrade from >> activerecord 2.3.8 to 3.0.7 and I''m getting a >> ActiveRecord::ConnectionNotEstablished error when the >> has_and_belongs_to_many association is being used. >> >> A simple example is attached, and the stack follows. Has anyone run >> into this before? >> >> !! Error loading /var/www/apps/arg/arg.rb: >> ActiveRecord::ConnectionNotEstablished: ActiveRecord::ConnectionNotEstablished >> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:317:in >> `retrieve_connection'' >> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in >> `retrieve_connection'' >> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in >> `connection'' >> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/associations.rb:1806:in >> `create_has_and_belongs_to_many_reflection'' >> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/associations.rb:1411:in >> `has_and_belongs_to_many'' >> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/autosave_association.rb:137:in >> `has_and_belongs_to_many'' >> /var/www/apps/arg/arg.rb:16:in `<class:Assembly>'' >> /var/www/apps/arg/arg.rb:15:in `<module:Models>'' >> /var/www/apps/arg/arg.rb:14:in `<top (required)>'' >> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:60:in >> `load'' >> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:60:in >> `load_apps'' >> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:105:in >> `reload!'' >> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:180:in >> `block in reload!'' >> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:179:in >> `each'' >> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:179:in >> `reload!'' >> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:158:in >> `update'' >> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/server.rb:157:in >> `find_scripts'' >> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/server.rb:161:in >> `reload!'' >> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/server.rb:169:in >> `call'' >> /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/lint.rb:48:in `_call'' >> /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/lint.rb:36:in `call'' >> /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/showexceptions.rb:24:in >> `call'' >> /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/commonlogger.rb:18:in >> `call'' >> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/server.rb:242:in >> `call'' >> /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/content_length.rb:13:in >> `call'' >> /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/handler/webrick.rb:52:in >> `service'' >> /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'' >> /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'' >> /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'' >> !! Error loading /var/www/apps/arg/arg.rb, see backtrace above >> 127.0.0.1 - - [24/May/2011 13:45:00] "GET / HTTP/1.1" 404 45 0.9436 >> >> -- >> Dave >> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- http://jeremymcanally.com/?-?http://arcturo.com/ Bowties, ties, and more:?http://wickhamhousebrand.com My books: http://r3uh.com ?http://rbip.info/ ?http://hlrb.org (FREE!)
Apparently its a known issue: http://webcache.googleusercontent.com/search?q=cache:cS8js8AYQHgJ:https://rails.lighthouseapp.com/projects/8994/tickets/6233 Looks like I get to migrate to has_many :through. :P Dave On Tue, May 24, 2011 at 2:49 PM, Jeremy McAnally <jeremymcanally at gmail.com> wrote:> It''s likely trying to get the columns or something like that and > doesn''t have a connection to do so. > > --Jeremy > > On Tue, May 24, 2011 at 2:21 PM, Magnus Holm <judofyr at gmail.com> wrote: >> It seems that you need to establish a connection *before* you write >> your models. Doesn''t seem to be a way around it :/ >> >> // Magnus Holm >> >> On Tue, May 24, 2011 at 19:53, David Susco <dsusco at gmail.com> wrote: >>> Not really Camping specific, but I''ve always had better luck asking on >>> this list than any of the rails ones. I''m trying to upgrade from >>> activerecord 2.3.8 to 3.0.7 and I''m getting a >>> ActiveRecord::ConnectionNotEstablished error when the >>> has_and_belongs_to_many association is being used. >>> >>> A simple example is attached, and the stack follows. Has anyone run >>> into this before? >>> >>> !! Error loading /var/www/apps/arg/arg.rb: >>> ActiveRecord::ConnectionNotEstablished: ActiveRecord::ConnectionNotEstablished >>> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:317:in >>> `retrieve_connection'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in >>> `retrieve_connection'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in >>> `connection'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/associations.rb:1806:in >>> `create_has_and_belongs_to_many_reflection'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/associations.rb:1411:in >>> `has_and_belongs_to_many'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_record/autosave_association.rb:137:in >>> `has_and_belongs_to_many'' >>> /var/www/apps/arg/arg.rb:16:in `<class:Assembly>'' >>> /var/www/apps/arg/arg.rb:15:in `<module:Models>'' >>> /var/www/apps/arg/arg.rb:14:in `<top (required)>'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:60:in >>> `load'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:60:in >>> `load_apps'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:105:in >>> `reload!'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:180:in >>> `block in reload!'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:179:in >>> `each'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:179:in >>> `reload!'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/reloader.rb:158:in >>> `update'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/server.rb:157:in >>> `find_scripts'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/server.rb:161:in >>> `reload!'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/server.rb:169:in >>> `call'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/lint.rb:48:in `_call'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/lint.rb:36:in `call'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/showexceptions.rb:24:in >>> `call'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/commonlogger.rb:18:in >>> `call'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/camping-2.1/lib/camping/server.rb:242:in >>> `call'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/content_length.rb:13:in >>> `call'' >>> /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/handler/webrick.rb:52:in >>> `service'' >>> /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'' >>> /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'' >>> /usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'' >>> !! Error loading /var/www/apps/arg/arg.rb, see backtrace above >>> 127.0.0.1 - - [24/May/2011 13:45:00] "GET / HTTP/1.1" 404 45 0.9436 >>> >>> -- >>> Dave >>> >>> _______________________________________________ >>> Camping-list mailing list >>> Camping-list at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >>> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > > > > -- > http://jeremymcanally.com/?-?http://arcturo.com/ > Bowties, ties, and more:?http://wickhamhousebrand.com > My books: > http://r3uh.com ?http://rbip.info/ ?http://hlrb.org (FREE!) > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- Dave