Homebrew: can't run ag (The Silver Searcher) - 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?

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.

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.

Related

Homebrew aspell directory not writable

I am having some difficulties. This started with a broader question but I seem (with some help from this list) to have narrowed things down a bit. My original query is at Emacs - Kieran Healy's Emacs Starter Kit aspell English dictionery
(And, yes, I am embarrassed at the spelling error in the title).
I have narrowed (with some help from that question) to narrow my problem down to the Homebrew installation of aspell. The command brew install aspell gives the following error.
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink lib/aspell-0.60/american-variant_0.alias
/usr/local/lib/aspell-0.60 is not writable.
You can try again using:
brew link aspell
If I try brew link aspell I get the following error:
Linking /usr/local/Cellar/aspell/0.60.6.1_1...
Error: Could not symlink lib/aspell-0.60/american-variant_0.alias
/usr/local/lib/aspell-0.60 is not writable.
File permissions on aspell are
drwxr-xr-x 89 root wheel 2848 7 Nov 2016 aspell-0.60
brew doctor gives
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that
depend on
those kegs to fail to run properly once built. Run `brew link` on
these:
aspell
It also tells me I need to update from XCode 9.3 to XCode 10.1, but since I am still running MacOS 10.13.4, I think I do not need to do this.
Any help greatly appreciated.
The info at Homebrew: Could not symlink, /usr/local/bin is not writable was helpful. I had to sudo chown -Rwhoami:admin /usr/local/lib. Then after unintalling and reinstalling aspell with Homebrew, I had to brew link --overwrite aspell. Everything works now.

Why can't brew find a specific known formula?

I'm trying to install bazel on my mac (10.11.5).
I can see that it is available through brew:
http://braumeister.org/formula/bazel
But when I run "brew install bazel", I get this:
Error: No available formula for bazel
Searching formulae...
Searching taps...
Why is this?
In my case, Homebrew was already up-to-date after running brew update and I still received the same error messages as the OP when trying to install xdebug:
$ brew update
Already up-to-date.
$ brew install php70-xdebug
Error: No available formula with the name "php70-xdebug"
Using Mark's suggestion from the comments on OP solved the problem:
$ brew search xdebug
homebrew/php/xdebug-osx homebrew/php/php70-xdebug
So now, running $ brew install homebrew/php/php70-xdebug, Homebrew found and installed the package.
You should update your brews, because it is indeed available. Run
brew update
brew install bazel
and then it should work.

Trouble with brew install devil

RGBDSLAM install is asking for devil
$ rosdep install rgbdslam
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
rgbdslam: No definition of [libdevil-dev] for OS [osx]
But when I try to install devil I'm getting this:
$ brew install devil
Error: devil cannot be built with any available compilers.
To install this formula, you may need to:
brew install gcc
$ brew install gcc
Warning: gcc-5.3.0 already installed
How can I get around this?
Note: I have xcode installed accompanied with the command line tools.
** EDIT libdevIL installed **
for some reason gcc 5 doesn't register when devIL is looking for gcc so I had to downgrade to 4.9.
$ brew rm gcc // removes 5
$ brew install gcc49 // installs 4.9
$ brew install devil // works
$ brew install gcc // two gcc installed? this might be interesting
rgbdslam still isn't detecting libdevIL though, not sure what the deal is.
Here's some helpful notes from answers.ros.org
I set siftgpu_disable_devil = 0 in SiftGPU/makefile and
set(ENV{SIFT_GPU_MODE} 0) in CMakeLists.txt with no avail. I'm
still seeing rgbdslam: No definition of [libdevil-dev] for OS [osx]
Commenting devIL out in package.xml put me a little further but
into some seemingly OSX specific issues, trying to resolve those via
github. Will respond here once I have a solution. Thanks for your
assistance.

gfortran error while installing using homebrew

Any help with this problem which I faced while trying gfortran using homebrew. Thank you very much in advance.
bash-3.2$ brew install gfortran
Warning: gfortran-4.8.0 already installed, it's just not linked
bash-3.2$ brew link gfortran
Linking /usr/local/Cellar/gfortran/4.8.0... Warning: Could not link gfortran. Unlinking...
Error: Could not symlink file: /usr/local/Cellar/gfortran/4.8.0/share/gcc-4.8.0/python
/libstdcxx/v6/printers.py
Target /usr/local/share/gcc-4.8.0/python/libstdcxx/v6/printers.py already exists.
You may need to delete it.
To force the link and delete this file, do:
brew link --overwrite formula_name
To list all files that would be deleted:
brew link --overwrite --dry-run formula_name
bash-3.2$
This looks like another GCC 4.8 installation, either from Homebrew or elsewhere, is conflicting with the gfortran install. GFortran is based on GCC so they can collide.
The gcc48 Homebrew formula looks like it has an undocumented conflict with gfortran. Both want to symlink /usr/local/share/gcc-4.8.0. I was able to reproduce your error with brew tap homebrew/versions; brew install gcc48; brew install gfortran
Head on over to the Homebrew issue tracker on GitHub and report this conflict as a bug.
As a workaround, if you don't need that GCC 4.8.0, either brew unlink gcc48 (if it's from homebrew) or uninstall it, and then try the gfortran install again.
UPDATE: Looks like the Homebrew folks are already aware of this issue. There is a fix for it included in this pull request (#19382).

imagemagick identify gives "dyld: Library not loaded: /usr/local/lib/libtiff.3.dylib"

after brew install imagemagick and brew install ghostscript on osx
when i run identify i get:
$ identify
dyld: Library not loaded: /usr/local/lib/libtiff.3.dylib
Referenced from: /usr/local/bin/identify
Reason: image not found
Trace/BPT trap: 5
this fixes it
ln -s /usr/local/Cellar/libtiff/3.9.5/lib/libtiff.3.dylib /usr/local/lib/libtiff.3.dylib
thanks to rlaraujo on this link https://github.com/mxcl/homebrew/issues/12099
I ran into the same problem recently on 10.6.8. I had ImageMagick installed (from way back) and then installed freetype and ghostscript and started getting the failure. The fix for me was simply to upgrade ImageMagick, which rebuilt and linked up to the newer libtiff and other libraries.
brew upgrade imagemagick
I ran into a similar problem with libpng library when I tried to use convertcommand with png files.
I first tried upgrading imagemagick but there were no upgrades available for the current version of brew I had. Updating brew and then upgrading ImageMagick solved the problem.
brew update
brew upgrade imagemagick

Resources