How to Install PCRE Development Headers on Mac OSX

0

I just upgraded my MacBook Pro to Mavericks and my local Ruby on Rails development environment isn't running straight off the bat, when I visit localhost I see It works! and remembered I needed to start Phusion Passenger, so when I run passenger start it checks all the requisites and fails when it gets to the PCRE Development Headers:

 * Checking for PCRE development headers...
    Found: no

It tells me to go to http://www.pcre.org/ to download them so I downloaded 8.33 from here which went to my Downloads folder, so I unzipped it, cd'd to the folder and ran:

./configure
make
make install

Then cd'd back to my rails app directory on my Desktop and re-ran passenger start but it's still the same. Tried a new Terminal window but that didn't make any difference.

I must have done this before to get my dev environment working but can't seem to solve it this time.

I also tried brew install pcre but it says Warning: pcre-8.33 already installed.

martincarlin87

Posted 2013-10-23T11:30:59.917

Reputation: 103

Answers

1

The PCRE headers on Mac OS X should be installed in /usr/bin.

You could try adding that to your $PATH.

Another thing to try is explicitly calling it on the commandline: C_INCLUDE_PATH=/usr/bin/ passenger start

Lastly you could try reinstalling/recompiling passenger as it may not have groked where the PCRE headers are on your system.

VogonPoetLaureate

Posted 2013-10-23T11:30:59.917

Reputation: 171

thanks, tried C_INCLUDE_PATH=/usr/bin/ passenger start but same result, will trying uninstalling and reinstalling passenger – martincarlin87 – 2013-10-23T12:23:37.903

reinstalling did the trick, passenger is now running but localhost is still saying It works! instead of showing my app, any ideas on that one? – martincarlin87 – 2013-10-23T12:26:37.607

Delete the index.html file in your app directory. – None – 2013-10-23T12:40:33.310

thanks but there's no index.html file in the app directory – martincarlin87 – 2013-10-23T12:56:29.683

The "It Works!" message is an Apache default located in an index.html file somewhere in the web server's default root (where, depends on how your apache is configured). – None – 2013-10-23T13:32:49.027

yeah, I think the problem is phusion passenger isn't correctly setup yet, just created a new question - http://stackoverflow.com/questions/19543094/apache-httpd-h-file-missing-macosx, my http.h file is missing somehow and I'm not sure how to repair that

– martincarlin87 – 2013-10-23T13:34:33.060

What does locate apache2 in the terminal come up with? – None – 2013-10-23T14:17:05.300

It says `WARNING: The locate database (/var/db/locate.database) does not exist. To create the database, run the following command:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist

Please be aware that the database can take some time to generate; once the database has been created, this message will no longer appear.` – martincarlin87 – 2013-10-23T14:17:46.233

Go ahead and create the database. It's very handy for debugging. – None – 2013-10-23T14:18:54.527

While you're waiting for that, did you install passenger-install-apache2-module using the sudo command or rvmsudo? – None – 2013-10-23T14:22:46.217

I tried using the sudo command but not the rvmsudo command. Got the same error. I think this is actually a common problem with Phusion Passenger after the Mavericks upgrade. – martincarlin87 – 2013-10-23T14:24:03.837

Yeah, might be related to Xcode. There's an update for it in software updates that might be helpful. – None – 2013-10-23T14:29:43.750

1

Found this fix at - https://stackoverflow.com/questions/19543094/apache-httpd-h-file-missing-on-macosx-after-mavericks-upgrade

  1. Update/install xcode
  2. run xcode-select --install- Update command line tools

Here are the remaining steps I took to get my site working.

  1. disabled/removed MacPorts/Fink
  2. brew install passenger - re-install homebrew
  3. rvm reinstall 2.0.0 or whatever version
  4. gem uninstall nokogiri - error with nokogiri
  5. gem install nokogiri
  6. bundle install
  7. restart terminal

and it worked! As a note, I am betting that if I had just installed passenger, RVM and restarted it would have worked after i did the xcode updates.

Casey Robbins

Posted 2013-10-23T11:30:59.917

Reputation: