Install dm-postgres-adapter on Mac

460 views Asked by At

I've been fighting on this for two days, time to ask to StackOverflow.

I've prepared a simple Ruby app (noob alert!) to start with this language. I've used Sinatra and DataMapper.

When using MySql everything went fine. I've installed the dm-mysql-adapter and then with a rake migrate the tables where automagically created. I tried to change mysql over postgres (to publish the app on Heroku) and now the problem.

Launching this command:

sudo gem install dm-postgres-adapter

will give:

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

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/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... yes
checking for mb/pg_wchar.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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/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}/
    --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}/
    --with-pqlib
    --without-pqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created

I've tried to uninstall and reinstall Postgres (through homebrew) and also passing to the gem install some of those parameters, for example:

sudo gem install dm-postgres-adapter -- --with-pgsql-server-dir=/usr/local/Cellar/postgresql/9.3.2/
sudo gem install dm-postgres-adapter -- --with-pgsql-server-dir=/usr/local/Cellar/postgresql/9.3.2/include/server/
sudo gem install dm-postgres-adapter -- --with-pgsql-server-include=/usr/local/Cellar/postgresql/9.3.2/include/

Any help on this?

0

There are 0 answers