Installing the Postgres gem on OSX using Postgres.app

Here is a quick tip on how to install the pg ruby gem on OSX if you only have Postgres.app installed. First, if you attempt to install the pg gem it will fail with: $ gem install pg Fetching: pg-0.17.1.gem (100%) Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /Users/me/.rbenv/versions/2.1.5/bin/ruby 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 *** If you search for solutions to this issue you will undoubtedly be told to install the postgresql package from Homebrew. That’s nice, but you already have the Postgres.app and you don’t want to maintain 2 versions of the same application on your machine (it is also not isolated, and can cause port conflicts). ...

December 18, 2014 · 1 min · 204 words · Scott Brown

Making Ansible and Vagrant Play Nice on OSX Mountain Lion

Here I was learning the ins and outs of Ansible so that I can provision my Vagrant installation with a modicum of scripting, when lo and behold it decides to abruptly fail on me. Searching around the Interwebs using the error I received didn’t help much, except to tie bits and pieces together. So I’m writing this in case (a) I ever forget the issue again, or (b) someone else gets tripped up on this. It isn’t in Ansible’s docs, so I’m guessing they are a Linux-only shop. ...

August 30, 2013 · 1 min · 200 words · Scott Brown