Malmoth Posted August 5, 2009 Posted August 5, 2009 The most recent Ruby gem for PostgreSQL access is pg. However, since the required PostgreSQL headers do not exist on the server, gem can't build the native extension for pg. Is it possible to install PostgreSQL headers? INFO: `gem install -y` is now default and will be removed INFO: use --ignore-dependencies to install only the gems you list Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb install -y pg 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/ruby --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 /home/malmoth/ruby/gems/gems/pg-0.8.0 for inspection. Results logged to /home/malmoth/ruby/gems/gems/pg-0.8.0/ext/gem_make.out
Ashoat Posted August 5, 2009 Posted August 5, 2009 Okay, I've just installed the pg gem from the root console. It is should now be available for use in your applications. Let me know if you have any difficulties.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now