无法安装charlock_holmes-0.6.9.4

use*_*647 0 ruby git ubuntu ruby-on-rails

将Ubuntu 13.04升级到14.04 LTS后,gitlab页面显示:502 GitLab没有响应.

我试过,进入/ home/git/gitlab目录这个命令:bundle install显示以下消息:

Make sure that `gem install charlock_holmes -v '0.6.9.4'` succeeds before bundling.
Run Code Online (Sandbox Code Playgroud)

这个命令的结果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.

        /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
*** 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
        --without-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=/usr/bin/ruby1.9.1
        --with-icu-dir
        --without-icu-dir
        --with-icu-include
        --without-icu-include=${icu-dir}/include
        --with-icu-lib
        --without-icu-lib=${icu-dir}/lib
        --with-icui18nlib
        --without-icui18nlib
        --with-icui18nlib
        --without-icui18nlib extconf.rb:55:in `chdir': No such file or directory - /var/lib/gems/1.9.1/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/src (Errno::ENOENT)
        from extconf.rb:55:in `<main>'


Gem files will remain installed in /var/lib/gems/1.9.1/gems/charlock_holmes-0.6.9.4 for inspection. Results logged to /var/lib/gems/1.9.1/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/gem_make.out
Run Code Online (Sandbox Code Playgroud)

当然,目录/var/lib/gems/1.9.1/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/只包含3个文件:extconf.rb,gem_make.out,mkmf.log

但是,这个目录/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/src包含2个文件:file-soft-check.patch,file-5.08.tar.gz和1个目录:file-5.08 /

我厌倦了符号链接,但每次运行命令时都会删除它.

有人能帮我吗 ?

谢谢


谢谢您的回复.运行此命令时出现新错误:

bundle install --deployment - 没有开发测试mysql aws

/usr/bin/ruby1.9.1 extconf.rb --with-dldflags=-licuuc -Wl,--export-all-symbols -Wl,--enable-auto-image-base,--enable-auto-import
checking for main() in -licui18n... yes
checking for main() in -licui18n... yes
checking for unicode/ucnv.h... yes
  -- tar zxvf file-5.08.tar.gz
  -- ./configure --prefix=/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/dst/ --disable-shared --enable-static --with-pic
  -- patch -p0 < ../file-soft-check.patch
  -- make -C src install
  -- make -C magic install
checking for main() in -lmagic_ext... yes
checking for magic.h... yes
creating Makefile

make
compiling encoding_detector.c
In file included from encoding_detector.c:3: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 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 transliterator.cpp
In file included from transliterator.cpp:1:0:
common.h:14:14: warning: ‘VALUE charlock_new_enc_str(const char*, size_t, void*)’ defined but not used [-Wunused-function]
 static VALUE charlock_new_enc_str(const char *str, size_t len, void *encoding)
              ^
common.h:32:14: warning: ‘VALUE charlock_new_str2(const char*)’ defined but not used [-Wunused-function]
 static VALUE charlock_new_str2(const char *str)
              ^
linking shared-object charlock_holmes/charlock_holmes.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libicui18n.a(smpdtfmt.ao): réadressage R_X86_64_PC32 vers symbole « _ZN6icu_5216SimpleDateFormat22fgCalendarFieldToLevelE » ne peut pas être utilisé en créant un objet partagé ; recompilé avec -fPIC
/usr/bin/ld: édition de lien finale en échec: Mauvaise valeur
collect2: error: ld returned 1 exit status
make: *** [charlock_holmes.so] Erreur 1
Run Code Online (Sandbox Code Playgroud)

evi*_*il0 5

这是一个与新的libicu版本相关的问题(icu-52而不是旧的icu-51)这对我有用:

删除charlock_holmes:

bundle exec gem uninstall charlock_holmes
Run Code Online (Sandbox Code Playgroud)

然后重新执行Bundle install(Postgres):

bundle install --deployment --without development test mysql aws
Run Code Online (Sandbox Code Playgroud)

(或MySQL):

bundle install --deployment --without development test postgres aws
Run Code Online (Sandbox Code Playgroud)