[ANN] postgres-pr (pure Ruby PostgreSQL)

M

Mauricio Fernández

???
try: gem list -r

Don't look for differences at the UI level, they are irrelevant anyway:
both RubyGems and rpa-base will have better interfaces in the future.
Other features might or might not be important, depending on your needs
(they were required for RPA's goals).

BTW, they are not two [opposing] camps. The RubyGems team have stated
they are going to make the repackaging (and incidentally RPA's) task
easier, and 1/5th of RubyGems' code comes straight from rpa-base.
 
E

Eivind Eklund

OH NO, you realize you're opening the proverbial can of worms, right? Last
time (if I recall correctly) things ended up with Gems vs. RPA'ers and at
each others throats.

I think a new recall is in order :) RPA and the Gems crew has a
fairly good relationship; especially after RubyGems committed to
fixing the main thing that has been seriously bothering the RPA team:
That RubyGems is hard to repackage, and this has been gnawing on our
relationship. With the RubyGems commitment, we're all much more
relaxed, and the RPA/RubyGems relationship is quite good :)

Eivind.
 
A

Aredridel

Ruby library writers, which one do you prefer or do you find easier to
In general, they should package using RubyGems or Aoki's setup.rb.
RPA packages are created by the RPA crew: the upstream developer needs
not do anything.

I'd like to pipe up here: I'm often around (#RPA on freenode) to talk
about packaging issue and production issues. Part of the idea is that
it takes some outside involvement to make a good package, to make sure
that things don't collide when loaded at the same time, making install
(and uninstall!) is 100% flawless; making sure that there's nothing
brittle that's likely to break by accident in the distribution.

It takes a lot to make a package production-quality (And I mean the
sort of production like, say, a bank might want for doing transaction
processing; known reliable software that has been tested as well as
checked over for accuracy). Library authors get about 90% of it
themselves, sometimes more. Then there's the things that only happen
when, you say, try to install a new package on ruby 1.6 on an HP/UX
machine, or say, fail to work reliably due to NFS locking issues;
those things take community testing to find.

RPA shies away from having people package their own work, because to
make a coherent system, a human double-check is really nice. In
non-trivial systems, issues come up. If we find some, we'll work with
the author on it. The idea is to get packages up to production quality
for the archive -- since maintenance is an issue, it implies that
getting the author to fix the problem or at least merge a fix into
their own source is the best way. If that's not possible, then the
package gets patched as it's committed to RPA.

The real goal, though, is to make ruby packages in general reliable.
rpa-base, the package manager, is just one way to accomodate that.

Software direct from author to user is great for the bleeding edge.
The early adopter crowd is willing (and in fact enjoys) the challenge
of working with the shifting sands of software. Other businesses won't
commit to something until it's been tested by others, until there's
some guarantee that they can rely on it without it changing beneath
them, that bugs will be fixed without being tied to incompatible API
changes, and that new features will be added on a strictly
won't-break-anything basis. There's room and a need for both in this
world.
 
S

Stu

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

and so doing a test .rb

require 'rubygems'
require_gem 'postgres-pr/connection', ">= 0.2.2"

c = Connection.new('dbtest', 'sgeorge')
c.query('SELECT 1+2')

It doesnt like it....

e:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:116:in `activate':
(Gem::LoadError)
Could not find RubyGem postgres-pr/Connection (>= 0.2.2)
from e:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:34:in
`require_gem'
from test.rb:2

I tried even PostgresPR::Connection.new, etc...

can you pass /connection in a reqiure_gem?

hmm so removing the /connection from the require_gem line gets me
test.rb:4: uninitialized constant Connection (NameError)

so... how exactly do I use it???

(I have a dbtest created and my username associated to that DB, I
checked that already with psql)....

what exactly am I doing wrong?



-- Stu --
[FAQ] Write Your Own Operating System
http://www.mega-tokyo.com/osfaq2
 
M

Michael Neumann

Stu said:
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
 
A

Abraham Vionas

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:[email protected]]
Sent: Monday, November 29, 2004 5:57 AM
To: ruby-talk ML
Subject: Re: [ANN] postgres-pr (pure Ruby PostgreSQL)
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
 
M

Michael Neumann

Abraham said:
Michael;

Does this mean there is a new Postgres-PR release available for
download/update?

You already have the newest version (0.2.2).
Also, I think the problems I'm having with a tutorial I'm working through
are related to Activerecord not communicating through PostgresPR...

No, it communicates through PostgresPR, I'm sure!
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...?

You don't have to setup anything.
RuntimeError in Todo#index

authentification failed

The problem is with authentification. You have either specified a wrong
user/password combination for Postgres, or it's an authentification
method that postgres-pr is not-yet capable of. Can you setup your
Postgres-database to either use password-less or plain-text password
authentification?

Regards,

Michael
 
A

Abraham Vionas

Thanks for the response Michael!

I looked into the topics you suggested and I think I made some progress...
at least now I can see attempts to connect to the db in the postgresql log.
However, it says that my user names don't exist, when I know they exist
because I can see them from psql - and from PGAdmin III. Any ideas?

My entry in the database.yml is:

production:
adapter: postgresql
database: todo
host: localhost
port: 5432
username: root

Errors in Postgresql log:

2004-11-29 19:49:02 FATAL: user "abrahamvionas_sr " does not exist
2004-11-29 19:57:59 FATAL: user "root " does not exist
2004-11-29 19:58:11 FATAL: user "root " does not exist




-----Original Message-----
From: Michael Neumann [mailto:[email protected]]
Sent: Monday, November 29, 2004 5:14 PM
To: ruby-talk ML
Subject: Re: [ANN] postgres-pr (pure Ruby PostgreSQL)

Abraham said:
Michael;

Does this mean there is a new Postgres-PR release available for
download/update?

You already have the newest version (0.2.2).
Also, I think the problems I'm having with a tutorial I'm working through
are related to Activerecord not communicating through PostgresPR...

No, it communicates through PostgresPR, I'm sure!
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...?

You don't have to setup anything.
RuntimeError in Todo#index

authentification failed

The problem is with authentification. You have either specified a wrong
user/password combination for Postgres, or it's an authentification
method that postgres-pr is not-yet capable of. Can you setup your
Postgres-database to either use password-less or plain-text password
authentification?

Regards,

Michael
 
C

Curt Hibbs

Abraham said:
Thanks for the response Michael!

I looked into the topics you suggested and I think I made some progress...
at least now I can see attempts to connect to the db in the
postgresql log.
However, it says that my user names don't exist, when I know they exist
because I can see them from psql - and from PGAdmin III. Any ideas?

My entry in the database.yml is:

production:
adapter: postgresql
database: todo
host: localhost
port: 5432
username: root

Errors in Postgresql log:

2004-11-29 19:49:02 FATAL: user "abrahamvionas_sr " does not exist
2004-11-29 19:57:59 FATAL: user "root " does not exist
2004-11-29 19:58:11 FATAL: user "root " does not exist

From the text above it looks lik you've got a tab character at the end of
your username. Perhaps root<tab> is being sent to the database, keeping the
username from matching. Try deleting this extraneous tab character and see
if that helps.

Curt
-----Original Message-----
From: Michael Neumann [mailto:[email protected]]
Sent: Monday, November 29, 2004 5:14 PM
To: ruby-talk ML
Subject: Re: [ANN] postgres-pr (pure Ruby PostgreSQL)

Abraham said:
Michael;

Does this mean there is a new Postgres-PR release available for
download/update?

You already have the newest version (0.2.2).
Also, I think the problems I'm having with a tutorial I'm working through
are related to Activerecord not communicating through PostgresPR...

No, it communicates through PostgresPR, I'm sure!
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...?

You don't have to setup anything.
RuntimeError in Todo#index

authentification failed

The problem is with authentification. You have either specified a wrong
user/password combination for Postgres, or it's an authentification
method that postgres-pr is not-yet capable of. Can you setup your
Postgres-database to either use password-less or plain-text password
authentification?

Regards,

Michael
 
A

Abraham Vionas

Yep, it's true. I'm kind of bleary eyed but if memory serves my problem may
have been heavily related to the fact that my database.yml file had extra
lines at the end. I.e. the configuration ended on line 19 (?) but the file
technically had another two lines in it (looking at it in a utility like
UltraEdit). Fixing that seemed to do the trick if I recall correctly.

Thanks for the idea Curt!



-----Original Message-----
From: Curt Hibbs [mailto:[email protected]]
Sent: Monday, November 29, 2004 8:55 PM
To: ruby-talk ML
Subject: Re: [ANN] postgres-pr (pure Ruby PostgreSQL)

Abraham said:
Thanks for the response Michael!

I looked into the topics you suggested and I think I made some progress...
at least now I can see attempts to connect to the db in the
postgresql log.
However, it says that my user names don't exist, when I know they exist
because I can see them from psql - and from PGAdmin III. Any ideas?

My entry in the database.yml is:

production:
adapter: postgresql
database: todo
host: localhost
port: 5432
username: root

Errors in Postgresql log:

2004-11-29 19:49:02 FATAL: user "abrahamvionas_sr " does not exist
2004-11-29 19:57:59 FATAL: user "root " does not exist
2004-11-29 19:58:11 FATAL: user "root " does not exist

From the text above it looks lik you've got a tab character at the end of
your username. Perhaps root<tab> is being sent to the database, keeping the
username from matching. Try deleting this extraneous tab character and see
if that helps.

Curt
-----Original Message-----
From: Michael Neumann [mailto:[email protected]]
Sent: Monday, November 29, 2004 5:14 PM
To: ruby-talk ML
Subject: Re: [ANN] postgres-pr (pure Ruby PostgreSQL)

Abraham said:
Michael;

Does this mean there is a new Postgres-PR release available for
download/update?

You already have the newest version (0.2.2).
Also, I think the problems I'm having with a tutorial I'm working through
are related to Activerecord not communicating through PostgresPR...

No, it communicates through PostgresPR, I'm sure!
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...?

You don't have to setup anything.
RuntimeError in Todo#index

authentification failed

The problem is with authentification. You have either specified a wrong
user/password combination for Postgres, or it's an authentification
method that postgres-pr is not-yet capable of. Can you setup your
Postgres-database to either use password-less or plain-text password
authentification?

Regards,

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top