将 gitlab 安装到我的 odroid 中就好了......使用https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/install/installation.md中的步骤,直到这个命令
sudo -u git -H bundle install --deployment --without development test postgres aws
但这只是未能安装 therubyracer 0.12.0(实际上,失败的是编译 v8,因为它需要 -fPIC 标志)。这是错误消息
/usr/bin/ld: /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/libv8-3.16.14.3/vendor/v8/out/arm.release/obj.target/tools/gyp/libv8_base.a(api.o): relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/libv8-3.16.14.3/vendor/v8/out/arm.release/obj.target/tools/gyp/libv8_base.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
所以...我通过克隆https://github.com/v8/v8并检查提交 7ce3fe106a37826dc23189a78dcb9000a1b3fa06在系统上安装了 v8 (b/c 这就是标签 v3.16.14.3 上 libv8 上使用的内容,这就是Gitlab 需要的那个)。
缺少的标志是-fPIC,所以在这样做之后make dependencies
我做了这个改变(把它作为一个补丁来做这样更容易看到......我只是在使用-Wall时添加了-fPIC)
--- build/standalone.gypi.original 2014-02-09 21:58:48.627732201 +0000
+++ build/standalone.gypi 2014-02-09 22:02:27.236682523 +0000
@@ -96,7 +96,7 @@
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
or OS=="netbsd"', {
'target_defaults': {
- 'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
+ 'cflags': [ '-fPIC', '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
'-Wnon-virtual-dtor', '-pthread', '-fno-rtti',
'-fno-exceptions', '-pedantic' ],
'ldflags': [ '-pthread', ],
@@ -206,7 +206,7 @@
'-fno-strict-aliasing',
],
'WARNING_CFLAGS': [
- '-Wall',
+ '-fPIC', '-Wall',
'-Wendif-labels',
'-W',
'-Wno-unused-parameter',
然后跑了make arm.release hardfp=on library=shared -j4
,等待......当它完成时,我只是sudo cp out/arm.release/lib.target/libv8.so /usr/lib/libv8.so
让 lib 可用。我也这样sudo cp include /usr/
做了,以便包含文件可用。
检查我安装了哪些 gem
odroid@odroid-server:~/v8$ gem query --local
*** LOCAL GEMS ***
bundler (1.5.3)
ref (1.0.5)
所以,我执行了sudo gem install libv8:3.16.14.3 -- --with-system-v8
你可以看到它已安装
odroid@odroid-server:~/v8/out/arm.release$ gem query --local
*** LOCAL GEMS ***
bundler (1.5.3)
libv8 (3.16.14.3)
ref (1.0.5)
但是现在,当我去 /home/git/gitlab 文件夹运行
sudo -u git -H bundle install --deployment --without development test postgres aws
再次失败......然后,我阅读了有关捆绑配置的信息,所以我运行
sudo -u git -H bundle config build.libv8 --with-system-v8
sudo -u git -H bundle install --deployment --without development test postgres aws
瞧!
但是……那么这个
odroid@odroid-server:/home/git/gitlab$ sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
ruby: symbol lookup error: /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/therubyracer-0.12.0/ext/v8/init.so: undefined symbol: _ZN2v82V821AddGCPrologueCallbackEPFvNS_6GCTypeENS_15GCCallbackFlagsEES1_
我尝试将所有内容从 v8/out/arm.release/obj.target/tools/gyp 复制到 /usr/lib 甚至复制到 /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/therubyracer-0.12 .0/ext/v8/ 没有运气
有谁知道如何使 v8 库可用?我认为这是我需要让它工作的最后一点信息。
谢谢!!!