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 <kmehd...@gmail.com> wrote: > [image: Boxbe] <https://www.boxbe.com/overview> This message is eligible > for Automatic Cleanup! (kmehd...@gmail.com) Add cleanup rule > <https://www.boxbe.com/popup?url=https%3A%2F%2Fwww.boxbe.com%2Fcleanup%3Ftoken%3DPqSmzzHs74HJBTjN9zD0mCdJS19aNjYicw8AHfc4U0uLgwG1FqXUuPy8Sm0ffkyKmJFTGvZ17%252FnwbGcdikWhhFxsO%252BkV9FqVqHjKXVYMSMQjnme3P4i9ZwxrR7%252FHuU1oThra%252FSFMaCE%253D%26key%3DAO0SIABcxxCrC4esEClwgERfmFvAzlpuNkfaiV2c9fA%253D&tc_serial=17995672109&tc_rand=1683534076&utm_source=stf&utm_medium=email&utm_campaign=ANNO_CLEANUP_ADD&utm_content=001> > | More info > <http://blog.boxbe.com/general/boxbe-automatic-cleanup?tc_serial=17995672109&tc_rand=1683534076&utm_source=stf&utm_medium=email&utm_campaign=ANNO_CLEANUP_ADD&utm_content=001> > > Make sure libpq-dev package is installed. > > > On Tue, Jul 22, 2014 at 9:44 PM, Himanshu Prakash <vision2...@gmail.com> > wrote: > >> 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 >> >> >> -- >> 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-talk+unsubscr...@googlegroups.com. >> To post to this group, send email to rubyonrails-talk@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/rubyonrails-talk/CANQThmuzCg4Scu4S_cSL%2BBRcHLzOg6LVTgPeuRpGKx0RAReHPQ%40mail.gmail.com >> <https://groups.google.com/d/msgid/rubyonrails-talk/CANQThmuzCg4Scu4S_cSL%2BBRcHLzOg6LVTgPeuRpGKx0RAReHPQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> 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-talk+unsubscr...@googlegroups.com. > To post to this group, send email to rubyonrails-talk@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/CABRbsVmNY5x51a612e3maQWEdYGKjX7y_Opn%2Bmw8ScVPBdzRfw%40mail.gmail.com > <https://groups.google.com/d/msgid/rubyonrails-talk/CABRbsVmNY5x51a612e3maQWEdYGKjX7y_Opn%2Bmw8ScVPBdzRfw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > 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-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CANQThmuEVDFZFFO6LQ7ZfgJ9ebgfPw3asJEPQmTub%3D%2B8d4zxHQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.