Undefined symbol using charlock_holmes gem

本小妞迷上赌 提交于 2019-12-11 02:05:20

问题


I installed icu on amazon ec2 with

sudo apt-get install libicu-dev

Then I installed charlock_holmes:

gem install charlock_holmes

It seemed to me that it was successfully installed:

Building native extensions. This could take a while...
Successfully installed charlock_holmes-0.6.9.4
1 gem installed

After that I got this:

.../shared/bundle/ruby/1.9.1/gems/charlock_holmes-0.6.9.4/lib/charlock_holmes.rb:1:in `require':
.../shared/bundle/ruby/1.9.1/gems/charlock_holmes-0.6.9.4/lib/charlock_holmes/charlock_holmes.so: 
  undefined symbol: _ZN6icu_518ByteSink15GetAppendBufferEiiPciPi   
.../shared/bundle/ruby/1.9.1/gems/charlock_holmes-0.6.9.4/lib/charlock_holmes/charlock_holmes.so (LoadError)

I tried also to install using this command:

gem install charlock_holmes -- --with-icu-dir=/usr/local/lib/

The error still occures. It seems to me that somehow I need to specify the right directory --with-icu-dir

The reason why I specified /usr/local/lib is because the icu libs are installed into that directory.


回答1:


gem install charlock_holmes -- --with-icu-dir=/usr/local 

worked for me when I ran into this problem. The dependencies are smart enough to look up lib for libs, include for header files, and the rest where appropriate under /usr/local.

I got these nasty test errors when installing the gem:

unable to convert "\xD0" from ASCII-8BIT to UTF-8 for ext/charlock_holmes/dst/bin/file, skipping
unable to convert "\xEE" from ASCII-8BIT to UTF-8 for ext/charlock_holmes/src/file-5.08/magic/Magdir/wordprocessors, skipping
unable to convert "\xE5" from ASCII-8BIT to UTF-8 for ext/charlock_holmes/src/file-5.08/magic/Magdir/riff, skipping
unable to convert "\xE1" from ASCII-8BIT to UTF-8 for ext/charlock_holmes/src/file-5.08/magic/Magdir/linux, skipping
unable to convert "\xE1" from ASCII-8BIT to UTF-8 for ext/charlock_holmes/src/file-5.08/magic/Magdir/natinst, skipping
unable to convert "\xBD" from ASCII-8BIT to UTF-8 for ext/charlock_holmes/src/file-5.08/magic/Magdir/filesystems, skipping
unable to convert "\xE1" from ASCII-8BIT to UTF-8 for ext/charlock_holmes/src/file-5.08/ChangeLog, skipping
unable to convert "\xD0" from ASCII-8BIT to UTF-8 for ext/charlock_holmes/src/file-5.08/src/file, skipping
unable to convert "\xCF" from ASCII-8BIT to UTF-8 for test/fixtures/hello_world, skipping

but they didn't seem to impact my app when running.



来源:https://stackoverflow.com/questions/16716678/undefined-symbol-using-charlock-holmes-gem

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!