安装坚固时发生错误

pli*_*ieb 45 git gem ruby-on-rails gitlab rugged

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

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

但安装坚固时发生错误:

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.
Run Code Online (Sandbox Code Playgroud)

所以我安装了坚固 - >我安装了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
Run Code Online (Sandbox Code Playgroud)

但它没有改变任何东西:

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.
Run Code Online (Sandbox Code Playgroud)

任何的想法 ?

Joe*_*Joe 71

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

brew install cmake 
bundle install
Run Code Online (Sandbox Code Playgroud)

  • 2022 年仍然如此:) (13认同)
  • 2023 年仍然如此:) (3认同)

xos*_*a74 59

首先,尝试安装cmake:

sudo apt-get install cmake
Run Code Online (Sandbox Code Playgroud)

然后,重复以下命令:

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

  • 对我来说,运行`sudo apt-get install cmake`就足够了. (7认同)
  • 为什么这么多 Gem 开发人员这样做,却让安装流程陷入了糟糕的状态,导致了如此多的问题?为什么 Gem 开发者不改进他们的指令或错误消息? (3认同)

小智 11

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

sudo apt-get install pkg-config
Run Code Online (Sandbox Code Playgroud)

进而

sudo gem install rugged -v '0.22.2'
Run Code Online (Sandbox Code Playgroud)

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

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