75

按照本教程 [链接] 在专用服务器上安装 gitlab。我需要 :

sudo -u git -H bundle install --deployment --without development test postgres aws

但是安装坚固耐用时出现错误:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby extconf.rb
checking for cmake... no
ERROR: CMake is required to build Rugged.
*** 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/local/bin/ruby


    Gem files will remain installed in /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rugged-0.21.2 for inspection.
    Results logged to /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rugged-0.21.2/ext/rugged/gem_make.out
    An error occurred while installing rugged (0.21.2), and Bundler cannot continue.
    Make sure that `gem install rugged -v '0.21.2'` succeeds before bundling.

所以我安装了坚固的 -> 我安装了 CMake & config-pkg :

/home/git/gitlab$ sudo gem install rugged
Building native extensions.  This could take a while...
Successfully installed rugged-0.21.2
Parsing documentation for rugged-0.21.2
unable to convert "\xC0" from ASCII-8BIT to UTF-8 for lib/rugged/rugged.so, skipping
1 gem installed

但它并没有改变任何东西:

Errno::EACCES: Permission denied - /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rugged-0.21.2/LICENSE
An error occurred while installing rugged (0.21.2), and Bundler cannot continue.
Make sure that `gem install rugged -v '0.21.2'` succeeds before bundling.

任何想法 ?

4

7 回答 7

111

对于 OSX,如果您使用的是自制软件:

brew install cmake 
bundle install
于 2016-04-13T02:06:57.040 回答
91

首先,尝试安装 cmake:

sudo apt-get install cmake

然后,重复命令:

sudo -u git -H bundle install --deployment --without development test postgres aws
于 2014-12-24T13:15:02.337 回答
13

对我来说,gem 抱怨 pkg-config 缺少依赖,所以我做了:

sudo apt-get install pkg-config

接着

sudo gem install rugged -v '0.22.2'

之后,我恢复到旧版本的 gitlab 并重新运行升级脚本。

我的 gitlab 旧版本是 6.9.2,升级版本是 8.0.5

于 2015-10-21T16:55:52.493 回答
1

注意:上述解决方案对我不起作用。


这是我得到的错误日志

checking for gmake... no
checking for make... yes
Building Rugged using system libraries.
libgit2 version is not compatible, expected ~> 0.99.0
*** 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.

主要是说libgit2 version is not compatible, expected ~> 0.99.0

gem install rugged -v '0.99.0'然后我尝试了bundle install

那么问题就解决了。

于 2020-11-01T12:16:47.593 回答
0

Mac OSX 10.6 或更高版本请参考此网址:

http://www.cmake.org/download/

于 2015-09-22T18:36:08.810 回答
0

只能这样解决这个问题:

https://cmake.org/download/下载。解压下载的 tar 文件,然后:

cd $CMAKE_DOWNLOAD_PATH
./configure
make
make install

在此步骤之后,我可以成功运行:

gem install rugged -v '0.26.0'
于 2018-05-15T09:42:11.803 回答
0

对我来说,这是 WSL ubuntu 20.04 环境中的 Openssl 问题

apt install cmake libssl-dev

也可能有助于运行 apt install ruby-dev pkg-config

于 2021-12-13T09:28:55.140 回答