datamapper / do

DataObjects
147 stars 74 forks source link

do_postgres won't install with postgresql-9.3 on Ubuntu 13.10 #66

Closed martinffx closed 10 years ago

martinffx commented 10 years ago

I can't seem to get do_postgres to install on ubuntu 13.10 with postgresql-9.3. I install postgresql and the dev libraries:

$ sudo apt-get install postgresql-9.3 libpq-dev

But when I try to install the do_postgres I get the following error:

$ gem install do_postgres
Building native extensions.  This could take a while...
ERROR:  Error installing do_postgres:
    ERROR: Failed to build gem native extension.

    /home/martin/.rbenv/versions/2.1.0/bin/ruby extconf.rb
checking for main() in -lpq... yes
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for postgres.h... 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=/home/martin/.rbenv/versions/2.1.0/bin/ruby
    --with-pgsql-server-dir
    --without-pgsql-server-dir
    --with-pgsql-server-include
    --without-pgsql-server-include=${pgsql-server-dir}/include
    --with-pgsql-server-lib
    --without-pgsql-server-lib=${pgsql-server-dir}/lib
    --with-pgsql-client-dir
    --without-pgsql-client-dir
    --with-pgsql-client-include
    --without-pgsql-client-include=${pgsql-client-dir}/include
    --with-pgsql-client-lib
    --without-pgsql-client-lib=${pgsql-client-dir}/lib
    --with-pqlib
    --without-pqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created

extconf failed, exit code 1

Gem files will remain installed in /home/martin/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/do_postgres-0.10.14 for inspection.
Results logged to /home/martin/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/do_postgres-0.10.14/gem_make.out

The pg installs fine, it just seems to be do_postgres

dbussink commented 10 years ago

You also need to install the postgres server dev headers.

martinffx commented 10 years ago

Thank you, that was nice and simple.

martinffx commented 10 years ago
sudo apt-get install postgresql-9.3 postgresql-server-dev-9.3 libpq-dev
supadoctor commented 10 years ago

Yep!!! Installing postgresql-server-dev-9.3 solved my problem too! Thanx!

zenith-777 commented 10 years ago

Thank you very much!! I install postgresql-server-dev-9.3 and solved the pg gem issue ^_^

shadowbq commented 9 years ago

+1 (thanks @martinffx )

gitshiva commented 9 years ago

same here, installing postgresql-dev-9.3 solved my issue as well, thanks for the post!

gregory commented 9 years ago

postgresql-server-dev-9.4 did the trick for me!

shkurkin commented 8 years ago

Thank you!! installing postgresql-server-dev-9.3 did the trick for me

aneta-bielska commented 8 years ago

+1 thank you! (installed postgresql-server-dev-9.3)

jensensen commented 8 years ago

need this for snorby on debian 8.6 and postgresql-server-dev-9.4 did the trick for me, also! thank you!

mdbxz commented 7 years ago

This worked for me: $ sudo chown -R USERNAME:USERNAME /var/lib/gems/2.3.0

MaxPleaner commented 7 years ago

postgresql-server-dev-9.4 and postgresql-server-dev-9.3 were not found in the packages list on Ubuntu 16.04 for me. I had to follow the instructions here to add the repository, then install the 9.4 package

martinffx commented 7 years ago

@MaxPleaner ubuntu really suck at keeping packages in there repo... it seems 16.04 only has 9.5 in there repos. And the package has changed to https://packages.ubuntu.com/xenial/database/postgresql-server-dev-all

sudo apt-get install postgresql-9.5 postgresql-server-dev-all libpq-dev

shadowbq commented 7 years ago

Postgresql supported lifecycle

Version Current_minor   Supported   First release date  EOL date
9.6 9.6.3       Yes     September 2016      September 2021
9.5 9.5.7       Yes     January 2016        January 2021
9.4 9.4.12      Yes     December 2014       December 2019
9.3 9.3.17      Yes     September 2013      September 2018
9.2 9.2.21      Yes     September 2012      September 2017

https://www.postgresql.org/support/versioning/