【问题标题】:An error occurred while installing rugged安装坚固耐用时发生错误
【发布时间】:2015-02-12 20:26:41
【问题描述】:

按照本教程 [link] 在专用服务器上安装 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.

有什么想法吗?

【问题讨论】:

  • git 用户可以阅读/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rugged-0.21.2/LICENSE(他应该)吗?因为你做了sudo gem install rugged 所以它们可能归根用户所有。
  • 你有一个更简单的方法在 ubuntu 中安装 GitLab,使用 gitlab omnibus package

标签: ruby-on-rails git gem gitlab rugged


【解决方案1】:

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

brew install cmake 
bundle install

【讨论】:

    【解决方案2】:

    首先,尝试安装 cmake:

    sudo apt-get install cmake
    

    然后,重复命令:

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

    【讨论】:

    • 对我来说,运行sudo apt-get install cmake 就足够了。
    • 这也解决了我的问题Make sure that gem install rough -v '0.25.0b2'` 在捆绑之前成功。` 尝试在我的 Gemfile 中使用 gem 'github-linguist' 时。干杯。
    • 为什么这么多 Gem 开发人员会这样做,并且让安装流程处于糟糕的状态,从而导致如此多的 SO 问题?为什么 Gem 开发人员不改进他们的指令或错误消息?
    【解决方案3】:

    对我来说,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

    【讨论】:

      【解决方案4】:

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


      这是我得到的错误日志

      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

      那么问题就解决了。

      【讨论】:

      • 以上内容对您不起作用,因为您的错误消息与问题不同。该问题涉及cmake 错误。
      【解决方案5】:

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

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

      【讨论】:

        【解决方案6】:

        只能这样解决这个问题:

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

        cd $CMAKE_DOWNLOAD_PATH
        ./configure
        make
        make install
        

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

        gem install rugged -v '0.26.0'
        

        【讨论】:

          【解决方案7】:

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

          运行 apt install cmake libssl-dev

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

          【讨论】:

            猜你喜欢
            • 2014-11-25
            • 1970-01-01
            • 2012-11-18
            • 2016-02-01
            • 2017-09-30
            • 1970-01-01
            • 2013-11-18
            • 1970-01-01
            • 2023-03-23
            相关资源
            最近更新 更多