Gem install pg works but bundle install fails

Nicolas Vergoz

There is very lot of topics about this but I already try almost all of them with no success.

I'm on Mac OS X 10.9.4 Mavericks, I have the Postgres.app, and it seams to work fine, sudo gem install pg works too :

Building native extensions.  This could take a while...
Successfully installed pg-0.17.1
invalid options: -f fivefish
(invalid options are ignored)
Parsing documentation for pg-0.17.1
Done installing documentation for pg after 2 seconds
1 gem installed

but when I try to bundle install I have the same error than every one else.

  • I already try bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config then bundle install

  • I have the Xcode Command Line Tools.

  • which psqlreturn /Applications/Postgres.app/Contents/Versions/9.3/bin/psql

  • which postgresreturn /Applications/Postgres.app/Contents/Versions/9.3/bin/postgres

Here is the error for bundle install:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
Using config values from /Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
    checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** 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-pg
    --without-pg
    --with-pg-config
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/
    --with-pqlib
    --without-pqlib
    --with-libpqlib
    --without-libpqlib
    --with-ms/libpqlib
    --without-ms/libpqlib

extconf failed, exit code 1

Gem files will remain installed in /var/folders/07/my1cl5xj7g9cknnp3y2zg_rh0000gn/T/bundler20140723-29399-1o0uzqn/pg-0.17.1/gems/pg-0.17.1 for inspection.
Results logged to /var/folders/07/my1cl5xj7g9cknnp3y2zg_rh0000gn/T/bundler20140723-29399-1o0uzqn/pg-0.17.1/extensions/universal-darwin-13/2.0.0/pg-0.17.1/gem_make.out
An error occurred while installing pg (0.17.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.1'` succeeds before bundling.
Nicolas Vergoz

After days I finally found the problem source (ironically when I decide to give up, and move on).

When I do a which bundle and which gem They were not from the same ruby installation. bundle was from rbenv and gem from the preinstalled ruby on mac osx.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Bundle Install Fails with unicorn gem on kgio install

From Dev

Rails s and bundle install error with pg gem?

From Dev

gem install pg fails on OSX 10.9

From Dev

gem install pg fails on OSX 10.9

From Dev

Rails pdf-extract gem has sqlite as dependency, but I'm using pg because Heroku requires it so bundle install fails

From Dev

Trying to install pg gem fails during ruby project build

From Dev

heroku run rake db:migrate fails, gem pg not found; gem install pg repeats

From Dev

RVM doesn't recognize installed gem, so bundle install fails

From Dev

Gem Install fails with UnsatisfiableDependencyError

From Dev

Install pg gem on CentOS 6

From Dev

gem install pg for ruby on rails

From Dev

Bundle Install will not update eventmachine gem

From Dev

gem install bundler, bundle not working

From Dev

Why does `gem install` work but not `bundle install`

From Dev

Gem Debugger won't install with bundle install

From Dev

Why does `gem install` work but not `bundle install`

From Dev

gem install on bundle folder (vendor/bundle)

From Dev

bundle install --without production remediates error, but why? ( Make sure that `gem install pg -v '0.18.1'` succeeds before bundling)

From Dev

Bundle install fails on production server

From Dev

Bundle install fails due to nokogiri

From Dev

`gem install berkshelf` in windows fails

From Dev

`gem install berkshelf` in windows fails

From Dev

Ubuntu "gem install rails" fails

From Dev

pg gem install fails, cannot find libpq-fe.h header

From Dev

Cannot install PG gem on Mac OSX

From Dev

gem install pg not working on Mac El Capitan

From Dev

Can't install pg gem on Rails

From Dev

Unable to install gem pg for ruby on rails

From Dev

can't bundle install json gem in ubuntu

Related Related

  1. 1

    Bundle Install Fails with unicorn gem on kgio install

  2. 2

    Rails s and bundle install error with pg gem?

  3. 3

    gem install pg fails on OSX 10.9

  4. 4

    gem install pg fails on OSX 10.9

  5. 5

    Rails pdf-extract gem has sqlite as dependency, but I'm using pg because Heroku requires it so bundle install fails

  6. 6

    Trying to install pg gem fails during ruby project build

  7. 7

    heroku run rake db:migrate fails, gem pg not found; gem install pg repeats

  8. 8

    RVM doesn't recognize installed gem, so bundle install fails

  9. 9

    Gem Install fails with UnsatisfiableDependencyError

  10. 10

    Install pg gem on CentOS 6

  11. 11

    gem install pg for ruby on rails

  12. 12

    Bundle Install will not update eventmachine gem

  13. 13

    gem install bundler, bundle not working

  14. 14

    Why does `gem install` work but not `bundle install`

  15. 15

    Gem Debugger won't install with bundle install

  16. 16

    Why does `gem install` work but not `bundle install`

  17. 17

    gem install on bundle folder (vendor/bundle)

  18. 18

    bundle install --without production remediates error, but why? ( Make sure that `gem install pg -v '0.18.1'` succeeds before bundling)

  19. 19

    Bundle install fails on production server

  20. 20

    Bundle install fails due to nokogiri

  21. 21

    `gem install berkshelf` in windows fails

  22. 22

    `gem install berkshelf` in windows fails

  23. 23

    Ubuntu "gem install rails" fails

  24. 24

    pg gem install fails, cannot find libpq-fe.h header

  25. 25

    Cannot install PG gem on Mac OSX

  26. 26

    gem install pg not working on Mac El Capitan

  27. 27

    Can't install pg gem on Rails

  28. 28

    Unable to install gem pg for ruby on rails

  29. 29

    can't bundle install json gem in ubuntu

HotTag

Archive