From ruby-pg at j-davis.com Wed Oct 1 11:58:52 2008 From: ruby-pg at j-davis.com (Jeff Davis) Date: Wed, 01 Oct 2008 08:58:52 -0700 Subject: [Ruby-pg-general] pg gem apparently installs fine, but then can't find libpq In-Reply-To: References: Message-ID: <1222876732.10988.124.camel@jdavis> On Tue, 2008-09-30 at 16:15 -0400, Michael Glaesemann wrote: > I'm having issues installing the pg gem on RHEL5: when I require 'pg', > the LoadError reports it can't find libpq.so. > > [grzm at db05 ~]$ ruby -rubygems -e 'require "pg"' > /usr/lib64/ruby/gems/1.8/gems/pg-0.7.9.2008.08.17/lib/pg.so: libpq.so. > 5: cannot open shared object file: No such file or directory - /usr/ > lib64/ruby/gems/1.8/gems/pg-0.7.9.2008.08.17/lib/pg.so (LoadError) > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in > `require' > from -e:1 > > libpq is in /usr/local/pgsql/lib: > > [grzm at db05 ~]$ ls -la /usr/local/pgsql/lib/libpq* Hi Michael, Try: $ LD_LIBRARY_PATH=/usr/local/pgsql/lib ruby -rubygems -e 'require "pg"' If that works, it's just a library path issue. You can make it system-wide by changing ld.so.conf and running ldconfig. Regards, Jeff Davis From grzm at seespotcode.net Wed Oct 1 17:08:08 2008 From: grzm at seespotcode.net (Michael Glaesemann) Date: Wed, 1 Oct 2008 17:08:08 -0400 Subject: [Ruby-pg-general] pg gem apparently installs fine, but then can't find libpq In-Reply-To: <1222876732.10988.124.camel@jdavis> References: <1222876732.10988.124.camel@jdavis> Message-ID: <0E152A64-9802-439A-85A3-41BD58EB835A@seespotcode.net> On Oct 1, 2008, at 11:58 , Jeff Davis wrote: > On Tue, 2008-09-30 at 16:15 -0400, Michael Glaesemann wrote: >> I'm having issues installing the pg gem on RHEL5: when I require >> 'pg', >> the LoadError reports it can't find libpq.so. >> >> [grzm at db05 ~]$ ruby -rubygems -e 'require "pg"' >> /usr/lib64/ruby/gems/1.8/gems/pg-0.7.9.2008.08.17/lib/pg.so: >> libpq.so. >> 5: cannot open shared object file: No such file or directory - /usr/ >> lib64/ruby/gems/1.8/gems/pg-0.7.9.2008.08.17/lib/pg.so (LoadError) >> from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in >> `require' >> from -e:1 >> >> libpq is in /usr/local/pgsql/lib: >> >> [grzm at db05 ~]$ ls -la /usr/local/pgsql/lib/libpq* > > Hi Michael, > > Try: > $ LD_LIBRARY_PATH=/usr/local/pgsql/lib ruby -rubygems -e 'require > "pg"' > > If that works, it's just a library path issue. You can make it > system-wide by changing ld.so.conf and running ldconfig. Thanks, Jeff. That's the ticket. And I learned a bit more linux fu along the way :) Michael Glaesemann grzm seespotcode net From amerik at dlife.com Wed Oct 15 15:39:16 2008 From: amerik at dlife.com (Alexey Amerik) Date: Wed, 15 Oct 2008 15:39:16 -0400 Subject: [Ruby-pg-general] how to iterate over get_copy_data Message-ID: <201C9B4E-2C80-42C5-BCE4-3B1836A29783@dlife.com> Hello..I have this code, I am able to get one row from the get_copy_data method, but I need the entire thing...can someone help? Thanks! sql_get_mem = "COPY (SELECT id, name FROM member) TO STDOUT WITH DELIMITER '|'" begin conn.exec(sql_get_mem) puts(conn.get_copy_data(sql_get_mem)) end Thank you very much From amerik at dlife.com Fri Oct 17 11:33:20 2008 From: amerik at dlife.com (Alexey Amerik) Date: Fri, 17 Oct 2008 11:33:20 -0400 Subject: [Ruby-pg-general] how to iterate over get_copy_data In-Reply-To: <201C9B4E-2C80-42C5-BCE4-3B1836A29783@dlife.com> References: <201C9B4E-2C80-42C5-BCE4-3B1836A29783@dlife.com> Message-ID: Ok :) I figured it out sql_get_mem = "COPY (SELECT id, name FROM member) TO STDOUT WITH DELIMITER '|'" res = conn.exec(sql_get_mem) while row = conn.get_copy_data() mem_out.puts(row) end res.clear() Thanks all. On Oct 15, 2008, at 3:39 PM, Alexey Amerik wrote: > Hello..I have this code, I am able to get one row from the > get_copy_data method, but I need the entire thing...can someone > help? Thanks! > > sql_get_mem = "COPY (SELECT id, name FROM member) TO STDOUT WITH > DELIMITER '|'" > > begin > conn.exec(sql_get_mem) > puts(conn.get_copy_data(sql_get_mem)) > end > > Thank you very much > _______________________________________________ > Ruby-pg-general mailing list > Ruby-pg-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/ruby-pg-general