From: Abraham Vionas Date: 2004-11-30T08:29:02+09:00 Subject: Re: [ANN] postgres-pr (pure Ruby PostgreSQL) Michael; Does this mean there is a new Postgres-PR release available for download/update? Also, I think the problems I'm having with a tutorial I'm working through are related to Activerecord not communicating through PostgresPR... It looks like it goes to it's connection_modules directory looking for a valid postgres connector and the default postgres connector included with Activerecord doesn't work for some reason. The precise error is below... but I'm curious how I can ensure (what settings to check, file locations, etc) that Activerecord can communicate to and through PostgresPR...? RuntimeError in Todo#index authentification failed c:/cs/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.2.2/lib/postgres-pr/connecti on.rb:58:in `initialize' c:/cs/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.2.2/lib/postgres-pr/connecti on.rb:32:in `loop' c:/cs/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.2.2/lib/postgres-pr/connecti on.rb:32:in `initialize' c:/cs/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.2.2/lib/postgres-pr/connecti on.rb:26:in `synchronize' c:/cs/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.2.2/lib/postgres-pr/connecti on.rb:26:in `initialize' c:/cs/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.2.2/lib/postgres-pr/postgres -compat.rb:22:in `new' c:/cs/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.2.2/lib/postgres-pr/postgres -compat.rb:22:in `initialize' c:/cs/ruby/lib/ruby/gems/1.8/gems/activerecord-1.1.0/lib/active_record/conne ction_adapters/postgresql_adapter.rb:34:in `connect' c:/cs/ruby/lib/ruby/gems/1.8/gems/activerecord-1.1.0/lib/active_record/conne ction_adapters/postgresql_adapter.rb:34:in `postgresql_connection' c:/cs/ruby/lib/ruby/gems/1.8/gems/activerecord-1.1.0/lib/active_record/conne ction_adapters/abstract_adapter.rb:140:in `send' c:/cs/ruby/lib/ruby/gems/1.8/gems/activerecord-1.1.0/lib/active_record/conne ction_adapters/abstract_adapter.rb:140:in `connection=' c:/cs/ruby/lib/ruby/gems/1.8/gems/activerecord-1.1.0/lib/active_record/conne ction_adapters/abstract_adapter.rb:104:in `retrieve_connection' c:/cs/ruby/lib/ruby/gems/1.8/gems/activerecord-1.1.0/lib/active_record/base. rb:172:in `connection' c:/cs/ruby/lib/ruby/gems/1.8/gems/activerecord-1.1.0/lib/active_record/base. rb:276:in `find_by_sql' c:/cs/ruby/lib/ruby/gems/1.8/gems/activerecord-1.1.0/lib/active_record/base. rb:270:in `find_all' c:/cs/ruby/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/sca ffolding.rb:103:in `list' c:/cs/ruby/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/sca ffolding.rb:96:in `index' c:/cs/ruby/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/bas e.rb:577:in `send' c:/cs/ruby/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/bas e.rb:577:in `perform_action_without_filters' c:/cs/ruby/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/fil ters.rb:236:in `perform_action_without_benchmark' c:/cs/ruby/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/ben chmarking.rb:30:in `perform_action_without_rescue' c:/cs/ruby/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/ben chmarking.rb:30:in `measure' c:/cs/ruby/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/ben chmarking.rb:30:in `perform_action_without_rescue' c:/cs/ruby/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/res cue.rb:68:in `perform_action' c:/cs/ruby/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/bas e.rb:254:in `process' c:/cs/ruby/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/bas e.rb:242:in `process' c:/cs/ruby/lib/ruby/gems/1.8/gems/rails-0.8.5/lib/dispatcher.rb:35:in `dispatch' /public/dispatch.rb:10 /public/dispatch.rb:1:in `load' /public/dispatch.rb:1 -:7 -----Original Message----- From: Michael Neumann [mailto:mneumann@ntecs.de] Sent: Monday, November 29, 2004 5:57 AM To: ruby-talk ML Subject: Re: [ANN] postgres-pr (pure Ruby PostgreSQL) Stu wrote: > On Fri, 19 Nov 2004 00:12:28 +0900, Michael Neumann > wrote: > > >> > gem install postgres-pr >> > irb -r rubygems >> >>Then in the interactive Ruby interpreter type (replace DBNAME and DBUSER >>accordingly): >> >> require 'postgres-pr/connection' >> c = Connection.new('DBNAME', 'DBUSER') >> c.query('SELECT 1+2') # => [["3"]] >> > > > Am having problems testing... > > I added 0.2.2 via gem install method.. > > and following the above I get; > > E:\ruby\code\postgres-test>irb -r rubygems > irb(main):001:0> require 'postgres-pr/connection' > => true > irb(main):002:0> c = Connection.new('dbtest', 'sgeorge') > NameError: uninitialized constant Connection from (irb):2 I moved everything into the PostgresPR module. c = PostgresPR::Connection.new(...) should work. Rubygems does not automatically inlude Module's. Regards, Michael