gem install pg -- --with-pgsql-include-dir='/usr/include/pgsql' --
with-pgsql-lib-dir='/usr/lib/pgsql'
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/
pg-0.9.0 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/pg-0.9.0/ext/
gem_make.out
from yum list postgres*, the relevant stuff I have installed is:
gem install pg -- --with-pgsql-include-dir=/usr/include/pgsql --with-
pgsql-lib-dir=/usr/lib/pgsql
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb --with-pgsql-include-dir=/usr/include/pgsql --
with-pgsql-lib-dir=/usr/lib/pgsql
checking for pg_config... yes
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/
pg-0.9.0 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/pg-0.9.0/ext/
gem_make.out
yum install postgresql-devel
Loaded plugins: presto, refresh-packagekit
Setting up Install Process
Package postgresql-devel-8.4.2-1.fc12.i686 already installed and
latest version
Nothing to do
The file is here: /usr/include/libpq-fe.h
but this doesn't work:
gem install pg -- --with-pgsql-include-dir=/usr/include
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb --with-pgsql-include-dir=/usr/include
checking for pg_config... yes
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/
pg-0.9.0 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/pg-0.9.0/ext/
gem_make.out
[root@458869-MITLL ext]#
and then I have this file here:
/usr/include/libpq-fe.h
I don't know if that means I have something wrong or incompatible on
my system or if I should just try copying the file into the directory
with the other ones
and then I have this file here:
/usr/include/libpq-fe.h
I don't know if that means I have something wrong or incompatible on
my system or if I should just try copying the file into the directory
with the other ones
Ok, I just did that, but I am having a problem that my gem command is
not working all of a sudden.
I had also tried to debug the extconf.rb, I had stepped inside a
function that appeared to hang so I killed the process.
gem --help
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:521:in `expand_path': No such
file or directory - getcwd (Errno::ENOENT)
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:521:in `find_files'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:520:in `map'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:520:in `find_files'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:1132
from /usr/bin/gem:8:in `require'
from /usr/bin/gem:8
> Try removing and re-installing the postgresql-devel package
>
> yum remove postgresql-devel
> yum install postgresql-devel
>
Ok, I just did that, but I am having a problem that my gem command is
not working all of a sudden.
I had also tried to debug the extconf.rb, I had stepped inside a
function that appeared to hang so I killed the process.
gem --help
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:521:in `expand_path': No such
file or directory - getcwd (Errno::ENOENT)
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:521:in `find_files'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:520:in `map'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:520:in `find_files'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:1132
from /usr/bin/gem:8:in `require'
from /usr/bin/gem:8
----
getcwd failure seems to indicate that your current path is a directory
that no longer exists (like it was deleted)
cd /
then try again
That was strange as 'ls' showed I was in a directory, but that fixed
that problem, but after the reinstall I still have the same problem:
also, the extra args don't allways seemed to matter as I get the same
error for
just "gem install pg" without the other args
gem install pg -- --with-pgsql-include-dir=/usr/include/pgsql --with-
pgsql-lib-dir=/usr/lib/pgsql
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb --with-pgsql-include-dir=/usr/include/pgsql --
with-pgsql-lib-dir=/usr/lib/pgsql
checking for pg_config... yes
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/
pg-0.9.0 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/pg-0.9.0/ext/
gem_make.out
[root@458869-MITLL /]#
(rdb:1) list
[683, 692] in /usr/lib/ruby/1.8/mkmf.rb
683 #
684 # For example, if have_header('foo.h') returned true, then the
HAVE_FOO_H
In trying to debug this, I am not sure if setting a breakpoint inside
of a block and not reaching it means that code never executed or could
it be peculiar to blocks in ruby. I feel like I want to edit the ruby
core stuff and put debug 'puts()' call in it to figure out what is
happening ..
685 # preprocessor macro would be passed to the compiler.
686 #
687 def have_header(header, &b)
=> 688 checking_for header do
689 if try_cpp(cpp_include(header), &b)
690 $defs.push(format("-DHAVE_%s", header.tr("a-z./\055", "A-
Z___")))
691 true
692 else
(rdb:1) break 689
Set breakpoint 2 at /usr/lib/ruby/1.8/mkmf.rb:689
(rdb:1) c
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
> ----
> getcwd failure seems to indicate that your current path is a directory
> that no longer exists (like it was deleted)
>
> cd /
>
> then try again
>
That was strange as 'ls' showed I was in a directory, but that fixed
that problem, but after the reinstall I still have the same problem:
also, the extra args don't allways seemed to matter as I get the same
error for
just "gem install pg" without the other args
gem install pg -- --with-pgsql-include-dir=/usr/include/pgsql --with-
pgsql-lib-dir=/usr/lib/pgsql
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb --with-pgsql-include-dir=/usr/include/pgsql --
with-pgsql-lib-dir=/usr/lib/pgsql
checking for pg_config... yes
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/
pg-0.9.0 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/pg-0.9.0/ext/
gem_make.out
[root@458869-MITLL /]#
I had put debug prints in the code and the reopen of stdout messed
that up. In reality it tries the gcc command below. I did not have gcc
installed, I then installed that. When I try the gcc command line from
the log I get the error below, except I don't know what directory ruby
issues that from:
I deleted the directory as you mentioned and reran it. I have some of
my debug print code in the make file utility here in that log file as
well:
/usr/bin/ruby extconf.rb
checking for pg_config... my in check_for
my postpone:mkmftmp1.log
my open:mkmf.log
step 2
step 3
#<File:mkmf.log>
#<IO:0xb78d6f64>
yes
my check for header
checking for libpq-fe.h... my in check_for
my postpone:mkmftmp1.log
my open:mkmf.log
step 2
step 3
#<File:mkmf.log>
#<IO:0xb78d6f64>
no
Can't find the 'libpq-fe.h header
*** 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.
I deleted the directory as you mentioned and reran it. I have some of
my debug print code in the make file utility here in that log file as
well:
/usr/bin/ruby extconf.rb
checking for pg_config... my in check_for
my postpone:mkmftmp1.log
my open:mkmf.log
step 2
step 3
#<File:mkmf.log>
#<IO:0xb78d6f64>
yes
my check for header
checking for libpq-fe.h... my in check_for
my postpone:mkmftmp1.log
my open:mkmf.log
step 2
step 3
#<File:mkmf.log>
#<IO:0xb78d6f64>
no
Can't find the 'libpq-fe.h header
*** 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.
ok, it seems to have worked. Thanks alot for your help ..
I tried to be carefull, but I realize that the way ruby functions
return default values that debug code in the wrong place can mess up
the return result. I often write code to return an explicit result.
After not making any sense of why it was erroring our, I restored the
non debug version of the mkmf.rb
gem install pg -- --with-pgsql-include-dir='/usr/include/pgsql' --
with-pgsql-lib-dir='/usr/lib/pgsql'
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/
pg-0.9.0 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/pg-0.9.0/ext/
gem_make.out
from yum list postgres*, the relevant stuff I have installed is:
just in case forks are still struggling with this(at least I was this
morning on fedora core 14 beta). I solved the same problem by installing
required development tools as: