簡體   English   中英

安裝Charlock_Holmes-無法構建gem本機擴展

[英]Installing Charlock_Holmes - Failed to build gem native extension

我是Ubuntu的新手,可以通過終端安裝gem。 我在安裝charlock_holmes時遇到了一些麻煩。 當我嘗試安裝時,遇到了這個大錯誤,我無法做出以下正誤:

ryan@ubuntu:~/Desktop/linguist$ sudo gem install charlock_holmes -v '0.7.3'
Building native extensions.  This could take a while...
ERROR:  Error installing charlock_holmes:
ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.9.1 extconf.rb
checking for main() in -licui18n... yes
checking for main() in -licui18n... yes
checking for unicode/ucnv.h... yes
checking for main() in -lz... yes
checking for main() in -licuuc... yes
checking for main() in -licudata... yes
creating Makefile

make
compiling converter.c
In file included from converter.c:2:0:
common.h:23:14: warning: ‘charlock_new_str’ defined but not used [-Wunused-     function]
static VALUE charlock_new_str(const char *str, size_t len)
          ^
common.h:32:14: warning: ‘charlock_new_str2’ defined but not used [-Wunused-    function]
static VALUE charlock_new_str2(const char *str)
          ^
compiling encoding_detector.c
In file included from encoding_detector.c:2:0:
common.h:14:14: warning: ‘charlock_new_enc_str’ defined but not used [-    Wunused-function]
 static VALUE charlock_new_enc_str(const char *str, size_t len, void     *encoding)
          ^
compiling ext.c
In file included from ext.c:1:0:
common.h:14:14: warning: ‘charlock_new_enc_str’ defined but not used [-    Wunused-function]
 static VALUE charlock_new_enc_str(const char *str, size_t len, void   *encoding)
          ^
common.h:23:14: warning: ‘charlock_new_str’ defined but not used [-Wunused-    function]
 static VALUE charlock_new_str(const char *str, size_t len)
          ^
common.h:32:14: warning: ‘charlock_new_str2’ defined but not used [-Wunused-    function]
static VALUE charlock_new_str2(const char *str)
          ^
compiling transliterator.cpp
make: g++: Command not found
make: *** [transliterator.o] Error 127


Gem files will remain installed in /var/lib/gems/1.9.1/gems/charlock_holmes-    0.7.3 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/charlock_holmes-0.7.3/ext/charlock_holmes/gem_make.out

我真的被困在下一步要做的事情上。 任何幫助將不勝感激。

從錯誤日志中,似乎未安裝g ++編譯器。 請使用以下命令進行安裝:

sudo apt-get install g++

然后運行以下命令:

sudo apt-get install libicu-dev   
sudo gem install charlock_holmes -v '0.7.3'

注意libicu-dev在機架上依賴於charlock_holmes

希望這會有所幫助!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM