2014年8月26日星期二

gitlab 7.1 install

system
centos5.6 64bit
kernel
2.6.18-238.el5xel

整体过程按照官网一步一步来:

下面记录安装过程中注意点以及遇到的错误解决方案:


1. 默认centos源不完整,下载epel源:
rpm -Uvh http://ftp.osuosl.org/pub/fedora-epel//5/x86_64/epel-release-5-4.noarch.rpm
再次安装(官网贴出的rpm包名和centos的又稍微区别,dev改为devel)
yum  install -y build-essential zlib1g-dev libyaml-devel libssl-devel libgdbm-devel libreadline-devel libncurses5-devel libffi-devel curl openssh-server redis checkinstall libxml2-devel libxslt-devel libcurl4-openssl-devel libicu-devel logrotate python-docutils (红色为找不到安装包,忽略)

2. 下载git
cd /tmp
wget https://www.kernel.org/pub/software/scm/git/git-2.0.0.tar.gz --no-check-certificate
cd git-2.0.0 
make prefix=/usr/local/ all && make prefix=/usr/local install

3.sudo -u git -H bundle install --deployment --without development test postgres aws
报错:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby extconf.rb 
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/2.1.0/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 "DESTDIR=" clean

make "DESTDIR="
compiling converter.c
In file included from converter.c:2:
common.h:41:7: warning: no newline at end of file
converter.c: In function b_converter_convert
                                             converter.c:7: warning: unused parameter elf
converter.c: At top level:
common.h:24: warning: harlock_new_strdefined but not used
common.h:33: warning: harlock_new_str2defined but not used
compiling ext.c
In file included from ext.c:1:
common.h:41:7: warning: no newline at end of file
ext.c:15:2: warning: no newline at end of file
common.h:15: warning: harlock_new_enc_strdefined but not used
common.h:24: warning: harlock_new_strdefined but not used
common.h:33: warning: harlock_new_str2defined but not used
compiling encoding_detector.c
In file included from encoding_detector.c:3:
common.h:41:7: warning: no newline at end of file
common.h:15: warning: harlock_new_enc_strdefined but not used
compiling transliterator.cpp
In file included from transliterator.cpp:1:
common.h:41:7: warning: no newline at end of file
transliterator.cpp: In function ALUE rb_transliterator_transliterate(VALUE, VALUE, VALUE)
                                                                                          transliterator.cpp:108: error: tringByteSinkwas not declared in this scope
transliterator.cpp:108: error: expected primary-expression before token
transliterator.cpp:108: error: inkwas not declared in this scope
transliterator.cpp:109: error: lass icu_3_6::UnicodeStringhas no member named oUTF8
make: *** [transliterator.o] Error 1
make failed, exit code 2

Gem files will remain installed in /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/charlock_holmes-0.6.9.4 for inspection.
Results logged to /home/git/gitlab/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0-static/charlock_holmes-0.6.9.4/gem_make.out
An error occurred while installing charlock_holmes (0.6.9.4), and Bundler cannot continue.
Make sure that `gem install charlock_holmes -v '0.6.9.4'` succeeds before bundling.
按照提示:
gem install charlock_holmes -v ‘0.6.9.4
报错:
[root@OPS_242 gitlab]# gem install charlock_holmes -v '0.6.9.4'
Fetching: charlock_holmes-0.6.9.4.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing charlock_holmes:
        ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby extconf.rb
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=/usr/local/lib/ruby/gems/2.1.0/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 "DESTDIR=" clean
make "DESTDIR="
compiling converter.c
In file included from converter.c:2:
common.h:41:7: warning: no newline at end of file
converter.c: In function b_converter_convert
                                             converter.c:7: warning: unused parameter elf
converter.c: At top level:
common.h:24: warning: harlock_new_strdefined but not used
common.h:33: warning: harlock_new_str2defined but not used
compiling ext.c
In file included from ext.c:1:
common.h:41:7: warning: no newline at end of file
ext.c:15:2: warning: no newline at end of file
common.h:15: warning: harlock_new_enc_strdefined but not used
common.h:24: warning: harlock_new_strdefined but not used
common.h:33: warning: harlock_new_str2defined but not used
compiling encoding_detector.c
In file included from encoding_detector.c:3:
common.h:41:7: warning: no newline at end of file
common.h:15: warning: harlock_new_enc_strdefined but not used
compiling transliterator.cpp
In file included from transliterator.cpp:1:
common.h:41:7: warning: no newline at end of file
transliterator.cpp: In function ALUE rb_transliterator_transliterate(VALUE, VALUE, VALUE)
                                                                                          transliterator.cpp:108: error: tringByteSinkwas not declared in this scope
transliterator.cpp:108: error: expected primary-expression before token
transliterator.cpp:108: error: inkwas not declared in this scope
transliterator.cpp:109: error: lass icu_3_6::UnicodeStringhas no member named oUTF8
make: *** [transliterator.o] Error 1
make failed, exit code 2
Gem files will remain installed in /usr/local/lib/ruby/gems/2.1.0/gems/charlock_holmes-0.6.9.4 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/charlock_holmes-0.6.9.4/gem_make.out
这是因为默认的yum源中libicu版本太低(3.6-5.16.1),不包含StringByteSink,安装4.2以上版本
解决方法:
下载4.2版本libicu以及liblicu-devel (下载地址http://rpm.pbone.net/index.php3)
#rpm -ivh libicu-4.2.1-9.1.el5.remi.x86_64.rpm 
#rpm -ivh libicu-devel-4.2.1-9.1.el5.remi.x86_64.rpm
然后再次运行:
[root@OPS_242 ~]# gem install charlock_holmes -v '0.6.9.4'
Building native extensions.  This could take a while...
Successfully installed charlock_holmes-0.6.9.4
Parsing documentation for charlock_holmes-0.6.9.4
Installing ri documentation for charlock_holmes-0.6.9.4
Done installing documentation for charlock_holmes after 0 seconds
1 gem installed
#sudo -u git -H bundle install --deployment --without development test postgres aws


没有评论:

发表评论