Getting Ruby to work with Postgres on Windows XP

D

Dillip Kumar

Hi there,

I have postgres 8.2 installed (not from the source, just the installer)
and would like to get ruby to talk to my postgres databases simply. I
have ruby-postgres installed and am using the extconf.rb to install it,
but it is having problems finding the correct libraries and headers.

do I need to install postgres from source? or where am I supposed to
point it to?

Any help would be greatly appreciated.

D
 
M

M. Edward (Ed) Borasky

Dillip said:
Hi there,

I have postgres 8.2 installed (not from the source, just the installer)
and would like to get ruby to talk to my postgres databases simply. I
have ruby-postgres installed and am using the extconf.rb to install it,
but it is having problems finding the correct libraries and headers.

do I need to install postgres from source? or where am I supposed to
point it to?

Any help would be greatly appreciated.

D

If you've got Ruby from the one-click installer, you should be able to
install the gems for the PostgreSQL interface. If you're behind a
firewall, you might need to have IT help you, but essentially, all you
need to do is open up the RubyGems command line gem installer that comes
with the one-click installer and install the gem(s).

There are two Ruby/PostgreSQL interface gems, one with some C language
code and one that is pure Ruby. Your problem indicates that you tried
the one with C code. I don't have a Windows system with one-click handy,
but my recollection is that the gem for the C-language version is
pre-compiled for Windows.

I have never used either version, so I can't comment on whether the pure
Ruby or the C-language version is "better" by any definition of the
word. But one way or another, if you use the one-click installer, you
should be able to get up and running via RubyGems without PostgreSQL source.
 
D

Damjan Rems

I use postgres-pr gem and it works fine with rails. As I remember
optimized driver does not work on Windows.

When I want to connect without ActiveRecord (Rails) I use ruby DBI gem.

Both can be found on RubyForge.


by
TheR
 
D

Dillip Kumar

Thank you both. Works great with postgres-pr.

I can't wait till I get off this Windows box :)

Dillip
 
K

Kevin Williams

I use the "ruby-postgres-0.7.1.2006.04.06-mswin32" gem all the time, no
compiler required. I've never tried postgres-pr, but I would assume the
C extension would be a bit more performant. Why not install the binary
gem instead of trying to install from source?
 

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

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top