Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Homebrew: can't run ag (The Silver Searcher)

Tags:

homebrew

My homebrew install of ag fails with:

$ ag
dyld: Library not loaded: /usr/local/lib/libpcre.1.dylib
  Referenced from: /usr/local/bin/ag
  Reason: image not found
Trace/BPT trap: 5

What do I need to do to fix this?

like image 228
Eric Hu Avatar asked Sep 23 '14 02:09

Eric Hu


2 Answers

A Japanese blog post covers what's necessary to fix this. libpcre.1.dylib is a file provided by the pcre Homebrew package.

The fix for this is to brew uninstall pcre && brew install pcre. ag should work after this.

like image 198
Eric Hu Avatar answered Nov 10 '22 13:11

Eric Hu


You SHOULD run brew doctor and follow what they suggested.

Mine is You have unlinked kegs in your Cellar due to the permission errors.

To fix this: run sudo chown yourname /lib/local/lib then run brew link pcre.

like image 23
user5137810 Avatar answered Nov 10 '22 13:11

user5137810