2

Hi I have been trying to install my Gemfile but every time I try I get this:

Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
Using addressable 2.3.5
Using backports 3.6.0
Using bcrypt 3.1.7
Using bcrypt-ruby 3.1.5
Using daemons 1.1.9
Using dm-core 1.2.1
Using dm-aggregates 1.2.0
Using dm-constraints 1.2.0
Using dm-migrations 1.2.0
Using fastercsv 1.5.5
Using json 1.8.1
Using json_pure 1.8.1
Using multi_json 1.9.2
Using dm-serializer 1.2.2
Using dm-timestamps 1.2.0
Using dm-transactions 1.2.0
Using stringex 1.5.1
Using uuidtools 2.1.4
Using dm-types 1.2.2
Using dm-validations 1.2.0
Using data_mapper 1.2.0
Using data_objects 0.10.14
Using dm-do-adapter 1.2.0

Gem::Ext::BuildError: 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

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/do_postgres-0.10.14 for         inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/do_postgres-0.10.14/gem_make.out
An error occurred while installing do_postgres (0.10.14), and Bundler cannot continue.
Make sure that `gem install do_postgres -v '0.10.14'` succeeds before bundling.        

My Gemfile contains this:

source 'https://rubygems.org'
ruby '2.0.0'

gem "sinatra"
gem "sinatra-contrib"
gem "sinatra-flash"
gem "thin"
gem 'data_mapper'
gem 'omniauth'
gem 'omniauth-google-oauth2'
gem 'omniauth-github'
gem 'sass'

group :development do
  gem 'dm-sqlite-adapter'
  gem 'do_sqlite3'
end

group :production do
  gem 'pg'
  gem 'dm-postgres-adapter' 
end

I have tried installing postgres manually and I have it installed on my computer but it keeps failing. I am running Mac OSX Mavericks

1
  • If you are just trying to get started developing and don't need postgres as your database, you can run "bundle install --without production". This will cause bundler to ignore the pg gem. Commented May 2, 2014 at 0:11

1 Answer 1

1

Try installing postgres with homebrew. http://www.moncefbelyamani.com/how-to-install-postgresql-on-a-mac-with-homebrew-and-lunchy/

Sign up to request clarification or add additional context in comments.

1 Comment

It work!! Thanks you so much, I've been trying this a long time

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.