Hi All,
I want to save data from a ruby script into a table in a PostGreSQL 8.4
database.
After looking into PostGreSQL connectivity in Ruby, I have come accross
the 'pg' gem.
I attempted to install the gem with the command: 'sudo gem install pg'
but got the following error:
sudo gem install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
checking for main() in -lpq... no
checking for main() in -llibpq... no
checking for main() in -lms/libpq... no
*** 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/bin/ruby1.8
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--with-pqlib
--without-pqlib
--with-libpqlib
--without-libpqlib
--with-ms/libpqlib
--without-ms/libpqlib
Could not find PostgreSQL build environment (libraries & headers):
Makefile not created
Gem files will remain installed in /var/lib/gems/1.8/gems/pg-0.8.0 for
inspection.
Results logged to /var/lib/gems/1.8/gems/pg-0.8.0/ext/gem_make.out
Would appreciate it if someone could point me in the right direction.
Saeed.
···
--
Posted via http://www.ruby-forum.com/.
Are you installing this on a mac, windows or a linux environment? You may
need to make sure your C/C++ compiler is configured on the platform for the
native extensions to compile and install.
Thanks, Shashank
···
On Fri, Feb 26, 2010 at 9:16 AM, Saeed Bhuta <saeed.bhuta@placr.co.uk>wrote:
Hi All,
I want to save data from a ruby script into a table in a PostGreSQL 8.4
database.
After looking into PostGreSQL connectivity in Ruby, I have come accross
the 'pg' gem.
I attempted to install the gem with the command: 'sudo gem install pg'
but got the following error:
sudo gem install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
checking for main() in -lpq... no
checking for main() in -llibpq... no
checking for main() in -lms/libpq... no
*** 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/bin/ruby1.8
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--with-pqlib
--without-pqlib
--with-libpqlib
--without-libpqlib
--with-ms/libpqlib
--without-ms/libpqlib
Could not find PostgreSQL build environment (libraries & headers):
Makefile not created
Gem files will remain installed in /var/lib/gems/1.8/gems/pg-0.8.0 for
inspection.
Results logged to /var/lib/gems/1.8/gems/pg-0.8.0/ext/gem_make.out
Would appreciate it if someone could point me in the right direction.
Saeed.
--
Posted via http://www.ruby-forum.com/\.
you need to install the postgresql development packages
···
On Fri, 2010-02-26 at 23:16 +0900, Saeed Bhuta wrote:
Could not find PostgreSQL build environment (libraries & headers):
This post was helpful because it helped me to realize that I needed gcc
installed to install the gem
thx
···
--
Posted via http://www.ruby-forum.com/.
Shashank Tiwari wrote:
Are you installing this on a mac, windows or a linux environment? You
may
need to make sure your C/C++ compiler is configured on the platform for
the
native extensions to compile and install.
Thanks, Shashank
Hi Shashank,
Thanks for replying. I'm using Linux Ubuntu Karmic Koala.
Saeed.
···
--
Posted via http://www.ruby-forum.com/\.
you need to install the postgresql development packages
I think I've done this already. Nonetheless, I'm going to try and
install it again. Do you know the name of the development packages?
Thanks,
Saeed.
···
--
Posted via http://www.ruby-forum.com/\.
Saeed Bhuta wrote:
Shashank Tiwari wrote:
Are you installing this on a mac, windows or a linux environment? You
may
need to make sure your C/C++ compiler is configured on the platform for
the
native extensions to compile and install.
Thanks, Shashank
I just installed the 'libecpg-dev' package and am now getting the
following error when trying to install the pg gem:
"sudo gem install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
checking for pg_config... yes
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** 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/bin/ruby1.8
--with-pg
--without-pg
--with-pg-config
--without-pg-config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--enable-static-build
--disable-static-build
--with-pqlib
--without-pqlib
--with-libpqlib
--without-libpqlib
--with-ms/libpqlib
--without-ms/libpqlib
Gem files will remain installed in /var/lib/gems/1.8/gems/pg-0.9.0 for
inspection.
Results logged to /var/lib/gems/1.8/gems/pg-0.9.0/ext/gem_make.out"
···
--
Posted via http://www.ruby-forum.com/\.
Run this...
$ dpkg --get-selections
and paste the results in a pastebin.
At this point, the gems is stating that it cannot find libpq ( the
postgresql C client library ). Do you have the postgresql client
packages installed?
reid
···
On Mon, 2010-03-01 at 17:56 +0900, Saeed Bhuta wrote:
Saeed Bhuta wrote:
> Shashank Tiwari wrote:
>> Are you installing this on a mac, windows or a linux environment? You
>> may
>> need to make sure your C/C++ compiler is configured on the platform for
>> the
>> native extensions to compile and install.
>>
>> Thanks, Shashank
I just installed the 'libecpg-dev' package and am now getting the
following error when trying to install the pg gem:
"sudo gem install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
checking for pg_config... yes
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** 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/bin/ruby1.8
--with-pg
--without-pg
--with-pg-config
--without-pg-config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--enable-static-build
--disable-static-build
--with-pqlib
--without-pqlib
--with-libpqlib
--without-libpqlib
--with-ms/libpqlib
--without-ms/libpqlib
Gem files will remain installed in /var/lib/gems/1.8/gems/pg-0.9.0 for
inspection.
Results logged to /var/lib/gems/1.8/gems/pg-0.9.0/ext/gem_make.out"
I believe the libecpg-dev package would only provide the required
packages for developing embedded sql programs.
Open synaptic, scroll down to the postgresql section, and look at the
available packages. Make sure you have appropriate server and client
packages installed as well as their associated dev packages.
···
On Mon, 2010-03-01 at 17:56 +0900, Saeed Bhuta wrote:
Saeed Bhuta wrote:
> Shashank Tiwari wrote:
>> Are you installing this on a mac, windows or a linux environment? You
>> may
>> need to make sure your C/C++ compiler is configured on the platform for
>> the
>> native extensions to compile and install.
>>
>> Thanks, Shashank
I just installed the 'libecpg-dev' package and am now getting the
following error when trying to install the pg gem:
Here is the result of the '$ dpkg --get-selections' command;
http://pastebin.com/6SRaW4KL
Looked in Synaptic, seemed like all the right server and client packages
were installed.
···
--
Posted via http://www.ruby-forum.com/.
Looks like you're missing the libpq5 and libpq-dev packages.
···
* Saeed Bhuta <saeed.bhuta@placr.co.uk> wrote:
Here is the result of the '$ dpkg --get-selections' command;
libxvmc1 installlibxxf86dga1 installlibxxf86misc1 installlibxx - Pastebin.com
Looked in Synaptic, seemed like all the right server and client packages
were installed.
--
Lars Haugseth
pastebin the output of
$ apt-cache search postgresql
···
On Mon, 2010-03-01 at 23:19 +0900, Saeed Bhuta wrote:
Here is the result of the '$ dpkg --get-selections' command;
libxvmc1 installlibxxf86dga1 installlibxxf86misc1 installlibxx - Pastebin.com
Looked in Synaptic, seemed like all the right server and client packages
were installed.
Lars Haugseth wrote:
Here is the result of the '$ dpkg --get-selections' command;
libxvmc1 installlibxxf86dga1 installlibxxf86misc1 installlibxx - Pastebin.com
Looked in Synaptic, seemed like all the right server and client packages
were installed.
Looks like you're missing the libpq5 and libpq-dev packages.
When I try to install them using the command:
sudo apt-get libpq5 libpq-dev
I get the message;
Reading package lists... Done
Building dependency tree
Reading state information... Done
libpq5 is already the newest version.
libpq-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
:S
···
* Saeed Bhuta <saeed.bhuta@placr.co.uk> wrote:
--
Posted via http://www.ruby-forum.com/\.
what do the following commands return
$pg_config --libdir
$pg_config --bindir
···
On Tue, 2010-03-02 at 00:58 +0900, Saeed Bhuta wrote:
Reid Thompson wrote:
> On Mon, 2010-03-01 at 23:19 +0900, Saeed Bhuta wrote:
>> Here is the result of the '$ dpkg --get-selections' command;
>> libxvmc1 installlibxxf86dga1 installlibxxf86misc1 installlibxx - Pastebin.com
>>
>> Looked in Synaptic, seemed like all the right server and client packages
>> were installed.
>
> pastebin the output of
>
> $ apt-cache search postgresql
nurpawiki - Wiki with integrated to-do list and schedulerodbc-postgresql - ODB - Pastebin.com
I don't think that is all of the output, I copied what was displayed on
the terminal.
Many Thanks,
Saeed
what does
$ ls -lrt /usr/lib/*libpq*
return
···
On Tue, 2010-03-02 at 17:24 +0900, Saeed Bhuta wrote:
Reid Thompson wrote:
> On Tue, 2010-03-02 at 00:58 +0900, Saeed Bhuta wrote:
>> > $ apt-cache search postgresql
>>
>> nurpawiki - Wiki with integrated to-do list and schedulerodbc-postgresql - ODB - Pastebin.com
>>
>> I don't think that is all of the output, I copied what was displayed on
>> the terminal.
>>
>> Many Thanks,
>>
>> Saeed
>
> what do the following commands return
>
> $pg_config --libdir
>
>
> $pg_config --bindir
pg_config --libdir
/usr/lib
pg_config --bindir
/usr/lib/postgresql/8.4/bin
Reid Thompson wrote:
>>
/usr/lib
pg_config --bindir
/usr/lib/postgresql/8.4/bin
what does
$ ls -lrt /usr/lib/*libpq*
return
ls -lrt /usr/lib/*libpq*
-rw-r--r-- 1 root root 217474 2009-09-09 17:51 /usr/lib/libpq.a
-rw-r--r-- 1 root root 151036 2009-09-09 17:51 /usr/lib/libpq.so.5.2
lrwxrwxrwx 1 root root 12 2009-11-30 12:12 /usr/lib/libpq.so.5 ->
libpq.so.5.2
lrwxrwxrwx 1 root root 12 2010-03-02 10:12 /usr/lib/libpq.so ->
libpq.so.5.2
···
On Tue, 2010-03-02 at 17:24 +0900, Saeed Bhuta wrote:
--
Posted via http://www.ruby-forum.com/\.
Reid Thompson wrote:
>> >>
>> /usr/lib
>>
>> pg_config --bindir
>> /usr/lib/postgresql/8.4/bin
>
> what does
> $ ls -lrt /usr/lib/*libpq*
>
> return
ls -lrt /usr/lib/*libpq*
-rw-r--r-- 1 root root 217474 2009-09-09 17:51 /usr/lib/libpq.a
-rw-r--r-- 1 root root 151036 2009-09-09 17:51 /usr/lib/libpq.so.5.2
lrwxrwxrwx 1 root root 12 2009-11-30 12:12 /usr/lib/libpq.so.5 ->
libpq.so.5.2
lrwxrwxrwx 1 root root 12 2010-03-02 10:12 /usr/lib/libpq.so ->
libpq.so.5.2
ok - that all looks right so far.
per your original email
Check the mkmf.log file for more
details.
what does mkmf.log contain?
on my box this file is located at
/usr/lib/ruby/gems/1.8/gems/pg-0.8.0/ext/mkmf.log
That may or may not be where your's is located.
···
On Tue, 2010-03-02 at 23:09 +0900, Saeed Bhuta wrote:
> On Tue, 2010-03-02 at 17:24 +0900, Saeed Bhuta wrote:
> Reid Thompson wrote:
> >> >>
> >> /usr/lib
> >>
> >> pg_config --bindir
> >> /usr/lib/postgresql/8.4/bin
> >
> > what does
> > $ ls -lrt /usr/lib/*libpq*
> >
> > return
>
>
> ls -lrt /usr/lib/*libpq*
> -rw-r--r-- 1 root root 217474 2009-09-09 17:51 /usr/lib/libpq.a
> -rw-r--r-- 1 root root 151036 2009-09-09 17:51 /usr/lib/libpq.so.5.2
> lrwxrwxrwx 1 root root 12 2009-11-30 12:12 /usr/lib/libpq.so.5 ->
> libpq.so.5.2
> lrwxrwxrwx 1 root root 12 2010-03-02 10:12 /usr/lib/libpq.so ->
> libpq.so.5.2
ok - that all looks right so far.
per your original email
> Check the mkmf.log file for more
> details.
what does mkmf.log contain?
on my box this file is located at
/usr/lib/ruby/gems/1.8/gems/pg-0.8.0/ext/mkmf.log
That may or may not be where your's is located.
doh -- your's is likely here
Gem files will remain installed in /var/lib/gems/1.8/gems/pg-0.9.0
for
···
On Tue, 2010-03-02 at 11:23 -0500, Reid Thompson wrote:
On Tue, 2010-03-02 at 23:09 +0900, Saeed Bhuta wrote:
> > On Tue, 2010-03-02 at 17:24 +0900, Saeed Bhuta wrote:
inspection.
Results logged to /var/lib/gems/1.8/gems/pg-0.9.0/ext/gem_make.out"