From: Shashank Tiwari Date: 2010-02-27T01:33:00+09:00 Subject: Re: Installing Pg gem for PostGreSQL 8.4 --0016e65ae914ae648904808373b1 Content-Type: text/plain; charset=UTF-8 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 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/. > > --0016e65ae914ae648904808373b1--