Unable to install pg gem: Could not create Makefile due to some reason

112 views
Skip to first unread message

Himanshu Prakash

unread,
Jul 22, 2014, 12:15:23 PM7/22/14
to rubyonra...@googlegroups.com
Hi All,
While installing postgres gem, getting following error-

#===== ERROR MESSAGE START ===========

Building native extensions.  This could take a while...

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/ext/builder.rb:54: warning: Insecure world writable dir /usr/local in PATH, mode 040777

ERROR:  Error installing pg:

ERROR: Failed to build gem native extension.


    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb

checking for pg_config... yes

Using config values from /usr/local/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

--without-pg-config

--with-pg_config

--without-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



Gem files will remain installed in /Users/apple/.rvm/gems/ruby-2.1.2@learning/gems/pg-0.17.1 for inspection.

Results logged to /Users/apple/.rvm/gems/ruby-2.1.2@learning/gems/pg-0.17.1/ext/gem_make.out

#===== ERROR MESSAGE END ===========

Googled a lot, but could not found any working solution. Could anyone please suggest what should be the resolution?

Here is my gem environment-

#=========== GEM ENVIRONMENT START ==================

RubyGems Environment:

  - RUBYGEMS VERSION: 2.0.14

  - RUBY VERSION: 2.0.0 (2014-02-24 patchlevel 451) [universal.x86_64-darwin13]

  - INSTALLATION DIRECTORY: /Users/apple/.rvm/gems/ruby-2.1.2@learning

  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby

  - EXECUTABLE DIRECTORY: /Users/apple/.rvm/gems/ruby-2.1.2@learning/bin

  - RUBYGEMS PLATFORMS:

    - ruby

    - universal-darwin-13

  - GEM PATHS:

     - /Users/apple/.rvm/gems/ruby-2.1.2@learning

     - /Users/apple/.rvm/gems/ruby-2.1.2@global

  - GEM CONFIGURATION:

     - :update_sources => true

     - :verbose => true

     - :backtrace => false

     - :bulk_threshold => 1000

  - REMOTE SOURCES:

     - https://rubygems.org/

#=========== GEM ENVIRONMENT END ==================

I am using OS X 10.9.4

I appreciate any help..


Thanks,

Himanshu Prakash


Khizer Mehdi

unread,
Jul 22, 2014, 12:29:11 PM7/22/14
to rubyonra...@googlegroups.com
Make sure libpq-dev package is installed.   


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CANQThmuzCg4Scu4S_cSL%2BBRcHLzOg6LVTgPeuRpGKx0RAReHPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Himanshu Prakash

unread,
Jul 24, 2014, 7:37:51 AM7/24/14
to rubyonra...@googlegroups.com, kmeh...@gmail.com
Thanks for you reply.

Following has helped me-

Use brew to get postgresql

brew install postgresql

Check you have pg_config in the installed brew. I found mine in

/usr/local/Cellar/postgresql/9.3.3/bin/pg_config

Check via :

$ ls /usr/local/Cellar/postgresql/9.3.3/bin/pg_config

> /usr/local/Cellar/postgresql/9.3.3/bin/pg_config

Once done, install the pg gem with

Ref- https://stackoverflow.com/questions/19625487/impossible-to-install-pg-gem-on-my-mac-with-mavericks/22259364#22259364?newreg=657757c5d48a4b6994d4868568d94c4b



On Tue, Jul 22, 2014 at 9:58 PM, Khizer Mehdi <kmeh...@gmail.com> wrote:
Boxbe This message is eligible for Automatic Cleanup! (kmeh...@gmail.com) Add cleanup rule | More info

Make sure libpq-dev package is installed.   
On Tue, Jul 22, 2014 at 9:44 PM, Himanshu Prakash <visio...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CANQThmuzCg4Scu4S_cSL%2BBRcHLzOg6LVTgPeuRpGKx0RAReHPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages