Ruby-on-rails 安装坚固耐用时发生错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27472234/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 00:00:03  来源:igfitidea点击:

An error occurred while installing rugged

ruby-on-railsgitgemgitlabrugged

提问by plieb

Following this tutorial [link] to install gitlab on a dedicated server. I need to :

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

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

But an error occurred while installing rugged :

但是在安装rugged 时出现错误:

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.

So I installed rugged -> I installed CMake & config-pkg :

所以我安装了坚固的 -> 我安装了 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

But it doesnt change anything :

但它不会改变任何东西:

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.

Any idea ?

任何的想法 ?

回答by Joe

For OSX if you're using homebrew:

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

brew install cmake 
bundle install

回答by xoska74

First, try installing cmake:

首先,尝试安装 cmake:

sudo apt-get install cmake

Then, repeat the command:

然后,重复命令:

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

回答by Adrián Suarez Bais

For me, gem was complaining about pkg-config missing dependence, so I did:

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

sudo apt-get install pkg-config

and then

进而

sudo gem install rugged -v '0.22.2'

after that, I revert to my older version of gitlab and re-run the script for the upgrade.

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

My older version of gitlab was 6.9.2 and the upgraded version 8.0.5

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

回答by railsfreak

Mac OSX 10.6 or later please refer to this url:

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

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

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

回答by Siarhei Manko

Can fix this problem only that way:

只能这样解决这个问题:

download from https://cmake.org/download/. Extract the downloaded tar file and then:

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

cd $CMAKE_DOWNLOAD_PATH
./configure
make
make install

And after this steps I could successfully run:

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

gem install rugged -v '0.26.0'