Could not find PostgreSQL build environment (libraries & headers): Makefile not created

884 views
Skip to first unread message

SVANATI

unread,
Dec 1, 2009, 9:54:31 AM12/1/09
to rubyrep
All,

I am installing rubyrep on a new i386 RHEL based server and I am
getting the following error when I try to install the Ruby postgres
driver.

--
sudo gem install postgres
Building native extensions. This could take a while...
ERROR: Error installing postgres:
ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
checking for main() in -lpq... 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/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-pqlib
--without-pqlib
Could not find PostgreSQL build environment (libraries & headers):
Makefile not created


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/
postgres-0.7.9.2008.01.28 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/
postgres-0.7.9.2008.01.28/ext/gem_make.out
--

I installed all the postgresql devel/lib rpms and I tried to install
with the flags pointing to the lib/include directory but with no luck.

I am new to Ruby so please advise.

Thanks in advance for the help.

Regards.

SVANATI

unread,
Dec 1, 2009, 1:29:19 PM12/1/09
to rubyrep
All,

I was able to resolve the issue. The solution is to make sure that
postgresql-devel, postgresql-libs, and gcc is installed on the server.

Hopes this helps.

Regards.
Reply all
Reply to author
Forward
0 new messages