加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby – “安装charlock_holmes时出错”:“icu required”

发布时间:2020-12-17 01:51:38 所属栏目:百科 来源:网络整理
导读:我正在尝试在我的Mac上安装charlock_holmes(10.7.5,ruby-1.9.3-p392),我遇到以下错误: $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
我正在尝试在我的Mac上安装charlock_holmes(10.7.5,ruby-1.9.3-p392),我遇到以下错误:

$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/

..但是我遇到了同样的错误.任何想法都会受到欢迎.

解决方法

我能够使用安装了macports的ICU版本安装这个gem,并指向–with-opt-include和–with-opt-lib到/ opt的子目录.

通过运行成功安装gem:

gem install charlock_holmes -v '0.6.9.4' -- --with-icu-dir=/opt/local/lib/icu --with-opt-include=/opt/local/include/ --with-opt-lib=/opt/local/lib/

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读