2

I am installing Rails on a fresh machine with OS X El Capitan using installrails.com.

Upon installing rails via the command line, I am now getting numerous errors as the system looks for outdated gems to download. Because the gems are not available, the installation cannot complete.

How should I proceed? I am fine with a fresh installation if needed.

Thanks!

First few errors I received --

Could not find CFPropertyList-2.3.2 in any of the sources
Run `bundle install` to install missing gems.

after running bundle install

Could not find fog-aliyun-0.0.10 in any of the sources

ran bundle update for fog-aliyun gem and got

Installing pg 0.18.3 with native extensions

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

/Users/supertext/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20151228-30240-pkfnrw.rb extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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.

And on and on with various outdated gems and permission issues.

Note: It was suggested that this was a duplicate. However, I am getting gem errors on dozens of gems, not just pg / postgresql. So while that note was helpful once I identified the upstream problem, it is not the sole answer to the question.

supertext
  • 232
  • 1
  • 13
  • Just in case, try to update the XCode and accept the terms by opening > accepting and close after, it gave me some headache before. Brew doctor maybe can help too if you are using homebrew. – Cassio Cabral Dec 29 '15 at 23:56
  • Possible duplicate of [Can't find the 'libpq-fe.h header when trying to install pg gem](http://stackoverflow.com/questions/6040583/cant-find-the-libpq-fe-h-header-when-trying-to-install-pg-gem) – Brad Werth Dec 29 '15 at 23:58
  • I've now narrowed down the problem to the following --> Rails is installed and working just fine when running a fresh app. When running an app with a few months of code on it and lots of gems, I get these many gem errors. So it's not actually an installation issue it seems. – supertext Dec 30 '15 at 02:01
  • Deleted gemfile.lock and ran bundle install. Now I encountered the pg gem error that Brad mentioned and am working through it. – supertext Dec 30 '15 at 02:05
  • `brew install postgresql` – Andrew Dec 30 '15 at 02:12
  • Are you on `mac` or `linux`? if second you `rpm` or `apt` to install postgres development packages before installing `pg` gem. – Малъ Скрылевъ Dec 30 '15 at 08:51
  • Thanks, install pg with brew install postgresql was the 2nd bit I needed. Thank you so much everyone! – supertext Jan 03 '16 at 11:42

1 Answers1

1

This ended up being a 2 part problem with particular emphasis on the first part which kept me hung up for awhile.

  1. I was new to cloning a git repo to a new machine and setting up my development environment to match. I cloned the repo and immediately started getting outdated gem errors (notices that the gem files were no longer available at rubygems.org). As a result, I learned I needed to delete gemfile.lock, bundle install to rebuild that file and install all the gems, and then proceed with making various adjustments until my new setup matched my previous one.

  2. One of the gems that was not installed was pg for postgresql. It had the nastiest but also most Googleable error and this question as well as the answers here helped to resolve it ==> Can't find the 'libpq-fe.h header when trying to install pg gem

Community
  • 1
  • 1
supertext
  • 232
  • 1
  • 13