Fish shell installation using homebrew – iconv libiconv error

command linehomebrewterminal

I am trying to install Fish shell using homebrew using command:

brew install fish

But the installation fails with the following error:

==> ./configure --prefix=/usr/local/Cellar/fish/2.1.1 SED=/usr/bin/sed
checking for library containing setupterm... -lncurses
checking for library containing nan... none required
checking for library containing iconv_open... no
checking for library containing libiconv_open... no
configure: error: Could not find an iconv implementation, needed to build fish

I tried searching around but no clear solution was found. System configuration:

$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: f03104755df8cbfb720254bd88ac7594a3837d36
Last commit: 11 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit haswell
OS X: 10.10.1-x86_64
CLT: 6.1.0.0.1.1413057044
Clang: 6.0 build 600
X11: N/A
System Ruby: 2.0.0-481
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby

Could you please help to fix this? Thanks!

Best Answer

In the log that you posted above the following three lines suggest that you have MacPorts installed.

checking for /opt/local/include include directory... yes
checking for /opt/local/lib library directory... yes
checking for /opt/local/bin command directory... yes

It also appears that brew is checking there before checking in its regular file locations (/usr/local, etc). Something under /opt might be confusing brew and preventing it from compiling fish.

This can be mended by following MacPorts uninstall guide: guide.macports.org/#installing.macports.uninstalling