ports/117367: databases/ruby-dbd_pg is not ready to use

Motomichi Matsuzaki mzaki at e-mail.ne.jp
Sun Oct 21 02:10:01 UTC 2007


>Number:         117367
>Category:       ports
>Synopsis:       databases/ruby-dbd_pg is not ready to use
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 21 02:10:00 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Motomichi Matsuzaki
>Release:        6.2-RELEASE w/ latest ports
>Organization:
>Environment:
FreeBSD localhost 6.2-RELEASE-p4 FreeBSD 6.2-RELEASE-p4 #0: Thu Apr 26 15:04:52 UTC 2007     root at amd64-builder.daemonology.net:/usr/obj/usr/src/sys/SMP  amd64
>Description:
databases/ruby-dbd_pg is a database driver for PostgreSQL in Ruby DBI.
As mentioned in the Ruby DBI project site (http://ruby-dbi.rubyforge.org/),
programmers can access databases in a vendor independent manner using Ruby DBI.

Generally said, programmers must load "dbi" interface library only.
But in the current databases/ruby-dbd_pg modified months ago, we have to load another library "rubygems", because the backend library databases/ruby-postgres have changed to be installed through RubyGem packaging framework.
This introduced inconsistency between driver libraries (DBDs) and portability problems into DBI-based ruby scripts.

The port should be fixed as to be used independent from "rubygems".

>How-To-Repeat:
mzaki$ ruby -e 'require "dbi"; DBI.connect("dbi:Pg:dbname=template1", "pgsql") {|dbh| puts dbh.select_one("SELECT 85 * 771")}'
/usr/local/lib/ruby/site_ruby/1.8/dbi.rb:344:in `load_driver': Could not load driver (no such file to load -- postgres) (DBI::InterfaceError)
        from /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:227:in `_get_full_driver'
        from /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:213:in `connect'
        from -e:1

To work correctly, loading "rubygems" is required:

mzaki$ ruby -e 'require "dbi"; require "rubygems"; DBI.connect("dbi:Pg:dbname=template1", "pgsql") {|dbh| puts dbh.select_one("SELECT 85 * 771")}'
65535

In case of databases/ruby-dbd_sqlite, for comparison:

mzaki$ ruby -e 'require "dbi"; DBI.connect("dbi:SQLite:hoge.db") {|dbh| puts dbh.select_one("SELECT 85 * 771")}'
65535

>Fix:
ruby-postgres port should be installed independently from rubygem framework.
Roll back repocopying databases/ruby-postgres to databases/rubygem-postgres.

Then databases/ruby-dbd_pg should depend on databases/ruby-postgres, not on databases/rubygem-postgres.

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list