按照本教程[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.
有什么想法吗?
答案 0 :(得分:67)
对于OSX,如果您正在使用自制程序:
Callback
答案 1 :(得分:57)
首先,尝试安装cmake:
sudo apt-get install cmake
然后,重复命令:
sudo -u git -H bundle install --deployment --without development test postgres aws
答案 2 :(得分:4)
对我来说,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
答案 3 :(得分:0)
Mac OSX 10.6或更高版本请参阅此网址:
答案 4 :(得分:0)
只能这样解决这个问题:
从https://cmake.org/download/下载。解压缩下载的tar文件,然后:
cd $CMAKE_DOWNLOAD_PATH
./configure
make
make install
在这些步骤之后,我可以成功运行:
gem install rugged -v '0.26.0'
答案 5 :(得分:0)
注意:上述解决方案对我不起作用。
这是我得到的错误日志
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
。
然后问题解决了。