views:

3507

answers:

4

Postgres 8.3 is installed on a windows 2008 server. Ruby 1.8-6 installed. gem install ruby-postgres.

When trying a simple connect I get

ruby.exe - Ordinal Not Found

The ordinal 284 could not be located in the dynamic link library SSLEAY32.dll.

OK

There seems to be some conflict betweeen the ssleay32 shipped with postgres 8.3 and the ruby 1.8-6

I know I could use the gem postgres-pr but I would prefere to use the ruby-postgres because that is what I use on all my other setup even if most of them is running under linux and not windows.

So the question is, Have any one solved this and how?

+1  A: 

Miles Georgi

That is probably the best way to start, but eventually you will want to be using ruby-postgres instead. The trick to getting that driver working is to copy 2 dll files to your c:\ruby\bin folder from your C:\program files\posgresql\lib folder. I think these 2 files are libeay32.dll and ssleay32.dll

i think a different approch is to use trust instead of md5 from localhost. Because this need of ssleay should be somthing with authentication I suppose.

Jonke
I still don't think this is solved, but i kind of works.
Jonke
A: 

To get a minimal thing without doing to much stuff under windows.

use: gem install ruby-postgres

then install the windows version of pgadmin and use all the needed files from there (cp from pgadmin\bin to ruby\bin or by setting PATH to the pgadmin\bin)

Jonke
A: 

I've never touched ruby or postgres but you are using an old version of openssl than the one it is compiled against. The newest version is openssl-0.9.8j so to build that:

Download and unpack then using visual c++ 2008 express + active perl:

C:\openssl-0.9.8j>perl Configure VC-WIN32

C:\openssl-0.9.8j>ms\do_masm

C:\openssl-0.9.8j>nmake -f ms\ntdll.mak

Tim Matthews
+2  A: 

Any even better solution, in so far as using the latest binaries for OpenSSL, is to rename both libeay32.dll and ssleay32.dll in both the ruby\bin folder and also the posgresql\lib folder and install the latest OpenSSL from http://www.slproweb.com/products/Win32OpenSSL.html, at the time of writing it was "Win32 OpenSSL v0.9.8j Light" put the dir in the path and away you go, it worked for me! You get the warm feeling of using the most up to date and secure OpenSSL libraries.

Bruce
Must try but this seems the best way sofar.
Jonke