[英]Cannot install uchardet gem on Mac OS catalina
最近在 MacOS catalina 中安裝 uchardet GEM 時出現以下錯誤,即使我指定了 ICU 版本和 lib,它仍然無法正常工作,有人有想法嗎?
Installing uchardet 0.2.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/xxx/.rvm/gems/ruby-2.6.4/gems/uchardet-0.2.0/ext
/Users/xxx/.rvm/rubies/ruby-2.6.4/bin/ruby -I /Users/xxx/.rvm/rubies/ruby-2.6.4/lib/ruby/site_ruby/2.6.0 -r ./siteconf20200420-38494-q9y0cf.rb extconf.rb
Could not find ICU libraries and/or development tools. Try installing "icu-devtools" or "icu" package.
*** 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.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/xxx/.rvm/rubies/ruby-2.6.4/bin/$(RUBY_BASE_NAME)
extconf failed, exit code 1
Gem files will remain installed in /Users/xxx/.rvm/gems/ruby-2.6.4/gems/uchardet-0.2.0 for inspection.
Results logged to /Users/xxx/.rvm/gems/ruby-2.6.4/extensions/x86_64-darwin-19/2.6.0/uchardet-0.2.0/gem_make.out
我能夠在我的 Mac 上重現它:
我通過重新安裝和重新鏈接icu4c
修復了這個錯誤
brew install icu4c
brew link icu4c --force # if it shows you an error and tells you to add the path manually add them
重新啟動我的終端然后重新安裝 gem(我也試過這個)
當您擁有which icu-config
工作時,您就會知道它正在工作
但是現在我有另一個錯誤uchardet.c:2:10: fatal error: 'unicode/ucsdet.h' file not found
我確實認為 gems 需要更好的配置
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.