我正在尝试在我的 Mac(10.7.5、ruby-1.9.3-p392)上安装 charlock_holmes,但遇到以下错误:
$gem install charlock_holmes -v '0.6.9.4'
Building native extensions.
This could take a while...
ERROR: Error installing charlock_holmes:
ERROR: Failed to build gem native extension.
/Users/mthompson/.rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
checking for main() in -licui18n... no
checking for main() in -licui18n... no
***************************************************************************************
*********** icu required (brew install icu4c or apt-get install libicu-dev) ***********
***************************************************************************************
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
我已经通过 macports 安装了 icu,所以我的 icu 目录是/opt/local/lib/icu
和/opt/local/share/icu
. 我尝试使用指定的目录进行安装:
$ gem install charlock_holmes -v '0.6.9.4' -- --with-icu-dir=/opt/local/lib/icu --with-opt-include=/usr/local/include/ --with-opt-lib=/usr/local/lib/
..但我遇到了同样的错误。任何想法都会受到欢迎。