Learnings
New Learning
About The App
Hire Me
Writing Samples
Edit Learning
Title
Body
Context: `rbenv exec bundle install` failed again on `pg` gem build (`Can't find the 'libpq-fe.h' header`). Although I had installed `libpq` via Homebrew, the build process (even when run via `rbenv exec`) didn't know where to find the necessary header files and libraries. Resolution: I explicitly configured Bundler to tell the `pg` gem build process where to find the Homebrew `libpq` installation using `rbenv exec bundle config build.pg --with-pg-config=/opt/homebrew/opt/libpq/bin/pg_config`, followed by `rbenv exec bundle install`. Learning: For gems with native extensions that depend on external libraries installed in non-standard locations (like Homebrew on Apple Silicon), I learned I may need to provide explicit configuration hints to the build process using `bundle config build.<gem_name> --with-<config-option>=/path/to/dependency`. Checking `brew info libpq` for paths is useful.
Learned on (YYYY-MM-DD)
Tags
Add comma-separated tags. They help filter learnings later.
Back to Learnings