Ruby-Postgres-0.7.1 Installation Question

(gregarican) #1

Has anyone out there been able to build the Ruby-Postgres-0.7.1 package
on the Zaurus platform? This package provides the driver interface
between Ruby and PostgreSQL. This is needed so I can start using Ruby
DBI on my Zaurus. I have Ruby 1.6.8 with the developer tree installed
on my SL-5500 and still cannot get the Ruby-Postgres-0.7.1 package to
install. When I run the extconf.rb functions such as socket() aren't
found. Just wondering if anyone has had to go through some of the
manual steps needed to get it working...

#2

gregarican wrote:

install. When I run the extconf.rb functions such as socket() aren't
found. Just wondering if anyone has had to go through some of the
manual steps needed to get it working...

A way to get the sockets is to cross-compile Ruby for ARM, with the
additonal advantage of getting a more recent version of Ruby. I did it
a while ago with a 1.8.2 preview, using the famous zruby.rb script, and
it worked. It required a couple of hours of manipulating header files
though. The libraries on the Zaurus were older than expected.

HTH,
Rainer

(gregarican) #3

Rainer wrote:

A way to get the sockets is to cross-compile Ruby for ARM, with the
additonal advantage of getting a more recent version of Ruby. I did it
a while ago with a 1.8.2 preview, using the famous zruby.rb script, and
it worked. It required a couple of hours of manipulating header files
though. The libraries on the Zaurus were older than expected.

Thanks for the tip. I will look into doing this. I recall working with
the Zaurus a few years ago and ran into the same things where I felt
like I was peeling an onion :slight_smile: There were a lot of deprecated files
and missing dependencies so to get some things working took a
considerable amount of time. But it was worth it if I succeeded and
accomplished what I set out to do. One of the things was a VoIP phone
application I ported over to the Z from some college project I ran
across on the Internet. The quality of the phone calls was rather poor
using my wifi card but it was fun working on it. This was all before I
discovered Ruby. Now that I am trying to leverage Ruby on the Z I am
interested in the old SL-5500 again. But of course the same old
frustrations due to my lack of proficiency at getting everything
together...sigh...

(gregarican) #4

gregarican wrote:

But of course the same old
frustrations due to my lack of proficiency at getting everything
together...sigh...

I am getting closer to stumbling onto this. I had to edit the
rbconfig.rb file that came with my Zaurus Ruby install so that the
correct gcc was being referenced. Next I had to monkey with the
LD_LIBRARY_PATH so that the proper library files are found. Now I have
the problem where the -lruby-static portion of the extconf.rb script is
failing. I assume that I will need the Ruby static libraries in order
to complete this installation?

(gregarican) #5

gregarican wrote:

I am getting closer to stumbling onto this. I had to edit the
rbconfig.rb file that came with my Zaurus Ruby install so that the
correct gcc was being referenced. Next I had to monkey with the
LD_LIBRARY_PATH so that the proper library files are found. Now I have
the problem where the -lruby-static portion of the extconf.rb script is
failing. I assume that I will need the Ruby static libraries in order
to complete this installation?

I googled around and found that I needed to comment out the reference
to static ruby libs in the rbconfig.rb. Now that I did so I get an
error in the mkmf.log stating that when trying the have_library
function for socket() the ld program can't find -lsocket. Is this
referring to the Ruby socket.so file or some socket file that should be
present in the PostgreSQL installation directories? I don't have
PostgreSQL compiled on the system. I just have the source code
directories since they have the include and lib directories that I
thought Ruby would need in order to install ruby-postgres-0.7.1. What
exactly is the extconf.rb script looking for when it's trying to find
socket()? If anyone could point me in the right direction (i.e. - Ruby
or PostgreSQL) I'd be eternally grateful :slight_smile:

#6

gregarican wrote:

function for socket() the ld program can't find -lsocket. Is this
referring to the Ruby socket.so file or some socket file that should be
present in the PostgreSQL installation directories? I don't have
PostgreSQL compiled on the system. I just have the source code
directories since they have the include and lib directories that I
thought Ruby would need in order to install ruby-postgres-0.7.1. What
exactly is the extconf.rb script looking for when it's trying to find
socket()? If anyone could point me in the right direction (i.e. - Ruby
or PostgreSQL) I'd be eternally grateful :slight_smile:

A guess: Glibc 2.0. Postgres has PQsocket. I have postgres-0.7.1
installed on a normal Linux system and there mkmf.log contains also
errors about not being able to find -lsocket or socket(). The Ruby
socket lib itself uses socket@@GLIBC_2.0