I have a slight problem. I have two machines. One is an app server and
the second is the database server running postgres. How do you install
the ruby postgres api on the app server to talk to the postgres on the
database server? I'm getting some errors on the installation.
Please elaborate on the situation.
which platform? what gem? some code?
/Kevin
···
On 6/21/06, Bing Tan <sombreroisland@gmail.com> wrote:
Hi everyone,
I have a slight problem. I have two machines. One is an app server and
the second is the database server running postgres. How do you install
the ruby postgres api on the app server to talk to the postgres on the
database server? I'm getting some errors on the installation.
You can install the pure Ruby driver using "gem install postgres-pr".
If you want to use the native driver (i.e., "gem install postgres")
you'll need to install the PostgreSQL header files and libraries on the
app server so that the gem installation process can compile the driver.
Yours,
Tom
···
On Wed, 2006-06-21 at 21:04 +0900, Bing Tan wrote:
Hi everyone,
I have a slight problem. I have two machines. One is an app server and
the second is the database server running postgres. How do you install
the ruby postgres api on the app server to talk to the postgres on the
database server? I'm getting some errors on the installation.
On 6/21/06, Tom Copeland <tom@infoether.com> wrote:
On Wed, 2006-06-21 at 21:04 +0900, Bing Tan wrote:
> Hi everyone,
>
> I have a slight problem. I have two machines. One is an app server and
> the second is the database server running postgres. How do you install
> the ruby postgres api on the app server to talk to the postgres on the
> database server? I'm getting some errors on the installation.
We have ruby version 1.8.4, fedora core 2, postgres version PostgreSQL
7.2.2
here is the error when I issue the command gem install postgres
Attempting local installation of 'postgres'
Local gem file not found: postgres*.gem
Attempting remote installation of 'postgres'
Building native extensions. This could take a while...
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-pgsql-dir
--without-pgsql-dir
--with-pgsql-include
--without-pgsql-include=${pgsql-dir}/include
--with-pgsql-lib
--without-pgsql-lib=${pgsql-dir}/lib
--with-wsock32lib
--without-wsock32lib
--with-socketlib
--without-socketlib
--with-inetlib
--without-inetlib
--with-nsllib
--without-nsllib
--with-pgsql-include-dir
--without-pgsql-include-dir
--with-pgsql-lib-dir
--without-pgsql-lib-dir
--with-pqlib
--without-pqlib
ERROR: While executing gem ... (RuntimeError)
ERROR: Failed to build gem native extension.
Gem files will remain installed in
/usr/local/lib/ruby/gems/1.8/gems/postgres-0.
7.1 for inspection.
ruby extconf.rb install postgres\nchecking for cygwin32_socket() in
-lwsock32. .. no
checking for socket() in -lsocket... no
checking for gethostbyname() in -linet... no
checking for gethostbyname() in -lnsl... yes
checking for sys/un.h... yes
checking for socket()... yes
checking for hsterror()... no
checking for gethostname()... yes
checking for PQsetdbLogin() in -lpq... no
Could not find PostgreSQL libraries: Makefile not created
Results logged to
/usr/local/lib/ruby/gems/1.8/gems/postgres-0.7.1/gem_make.out
Kevin Ilchmann Jørgensen wrote:
···
On 6/21/06, Bing Tan <sombreroisland@gmail.com> wrote:
Hi everyone,
I have a slight problem. I have two machines. One is an app server and
the second is the database server running postgres. How do you install
the ruby postgres api on the app server to talk to the postgres on the
database server? I'm getting some errors on the installation.
thanks,
Bing
Hey.
Please elaborate on the situation.
which platform? what gem? some code?
We have ruby version 1.8.4, fedora core 2, postgres version
PostgreSQL
7.2.2
here is the error when I issue the command gem install postgres
Attempting local installation of 'postgres'
Local gem file not found: postgres*.gem
Attempting remote installation of 'postgres'
Building native extensions. This could take a while...
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack
of necessary libraries and/or headers. Check the mkmf.log
file for more details. You may need configuration options.
Do you have the postgresql-devel RPMs installed? If I recall correctly,
that RPM contains the header files and libraries and whatnot.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack
of necessary libraries and/or headers. Check the mkmf.log
file for more details. You may need configuration options.
Do you have the postgresql-devel RPMs installed? If I recall correctly,
that RPM contains the header files and libraries and whatnot.
I have Installed this rpm postgresql-7.4.7-3.FC2.1.src.rpm because I
have having trouble with the binary rpm, The source rpm was installed
correctly, but when I try the gem install postgres I still encounter the
same error above.
Bing Tan wrote:
···
ok will try that one, thanks
Tom Copeland wrote:
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack
of necessary libraries and/or headers. Check the mkmf.log
file for more details. You may need configuration options.
Do you have the postgresql-devel RPMs installed? If I recall correctly,
that RPM contains the header files and libraries and whatnot.
I have Installed this rpm postgresql-7.4.7-3.FC2.1.src.rpm because I
have having trouble with the binary rpm, The source rpm was installed
correctly, but when I try the gem install postgres I still encounter the
same error above.
On 6/22/06, Bing Tan <sombreroisland@gmail.com> wrote:
Bing Tan wrote:
> ok will try that one, thanks
>
> Tom Copeland wrote:
>>> *** extconf.rb failed ***
>>> Could not create Makefile due to some reason, probably lack
>>> of necessary libraries and/or headers. Check the mkmf.log
>>> file for more details. You may need configuration options.
>>
>> Do you have the postgresql-devel RPMs installed? If I recall correctly,
>> that RPM contains the header files and libraries and whatnot.
>>
>> Yours,
>>
>> Tom
Ok, so I've tried doing the installations but I'm now getting this error
when doing my test. It seems like the driver isn't being seen?:
/usr/local/lib/ruby/site_ruby/1.8/dbi/dbi.rb:499:in `load_driver': is
not a class/module (TypeError)
from /usr/local/lib/ruby/site_ruby/1.8/dbi/dbi.rb:401:in
`_get_full_driver'
from /usr/local/lib/ruby/site_ruby/1.8/dbi/dbi.rb:381:in
`connect'
from ./test_connect.rb:7
Here is my test code:
#!/usr/local/bin/ruby
require "dbi"
URL = "dbi:pg:dbname:192.168.22.1:port=5432"
dbh = DBI.connect(URL,"username","password")
Note that the ip address here is on a remote machine in a local loop.
might help, anyway it cant find the driver
what is the content of your /ruby/DBD/ dir ?
···
On 6/22/06, Bing Tan <sombreroisland@gmail.com> wrote:
Ok, so I've tried doing the installations but I'm now getting this error
when doing my test. It seems like the driver isn't being seen?:
/usr/local/lib/ruby/site_ruby/1.8/dbi/dbi.rb:499:in `load_driver': is
not a class/module (TypeError)
from /usr/local/lib/ruby/site_ruby/1.8/dbi/dbi.rb:401:in
`_get_full_driver'
from /usr/local/lib/ruby/site_ruby/1.8/dbi/dbi.rb:381:in
`connect'
from ./test_connect.rb:7
might help, anyway it cant find the driver
what is the content of your /ruby/DBD/ dir ?
Hi Kevin,
I already have pg.rb on my DBD dir :(. Looking at my test code though,
am I using it correctly? do I have the right syntax particularly my
DBI.connect?
Here it is again:
#!/usr/local/bin/ruby
require "dbi"
URL = "dbi:pg:dbname:192.168.22.1:port=5432"
dbh = DBI.connect(URL,"username","password")
Bing
···
On 6/22/06, Bing Tan <sombreroisland@gmail.com> wrote: