An error occurred while installing rugged
Asked Answered
S

7

93

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

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

But an error occurred while installing 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 :

/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 ?

Staphyloplasty answered 14/12, 2014 at 17:56 Comment(2)
Can the git user read /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rugged-0.21.2/LICENSE (he should)? Because you didd sudo gem install rugged so they might be owned by root.Gypsy
You have a much more easy way to install GitLab in ubuntu, using the gitlab omnibus packageForester
B
106

First, try installing cmake:

sudo apt-get install cmake

Then, repeat the command:

sudo -u git -H bundle install --deployment --without development test postgres aws
Balloon answered 24/12, 2014 at 13:15 Comment(3)
To me, running sudo apt-get install cmake was enough.Ballenger
This has also fixed my issue Make sure that gem install rugged -v '0.25.0b2'` succeeds before bundling.` when trying to use gem 'github-linguist' in my Gemfile in rails. Cheers.Empery
Why do so many Gem developers do this and leave install flows in terrible shape, leading to so many SO questions like this? Why don't Gem developers improve their instructions or error messages?Unvoice
F
152

For OSX if you're using homebrew:

brew install cmake 
bundle install
Filmy answered 13/4, 2016 at 2:6 Comment(4)
Still the case in 2022 :)Breed
Still the case in 2023 :)Austreng
Still the case in 2023 november :)Anguished
Still the case in 2024Shopper
B
106

First, try installing cmake:

sudo apt-get install cmake

Then, repeat the command:

sudo -u git -H bundle install --deployment --without development test postgres aws
Balloon answered 24/12, 2014 at 13:15 Comment(3)
To me, running sudo apt-get install cmake was enough.Ballenger
This has also fixed my issue Make sure that gem install rugged -v '0.25.0b2'` succeeds before bundling.` when trying to use gem 'github-linguist' in my Gemfile in rails. Cheers.Empery
Why do so many Gem developers do this and leave install flows in terrible shape, leading to so many SO questions like this? Why don't Gem developers improve their instructions or error messages?Unvoice
D
17

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

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.

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

Disinclined answered 21/10, 2015 at 16:55 Comment(0)
T
1

Can fix this problem only that way:

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

cd $CMAKE_DOWNLOAD_PATH
./configure
make
make install

And after this steps I could successfully run:

gem install rugged -v '0.26.0'
Typhon answered 15/5, 2018 at 9:42 Comment(1)
works for CentosExpletive
I
1

Note: The above mentioned solutions did not work for me.


Here is the error log I got

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.

It was mainly saying libgit2 version is not compatible, expected ~> 0.99.0

and I tried gem install rugged -v '0.99.0' and then bundle install.

then the problem is solved.

Ity answered 1/11, 2020 at 12:16 Comment(1)
The above didn't work for you because you have a different error message than the question. The question refers to a cmake error.Gardener
E
1

For me it was Openssl problem in a WSL ubuntu 20.04 env

Run apt install cmake libssl-dev

might also help to run apt install ruby-dev pkg-config

Edict answered 13/12, 2021 at 9:28 Comment(0)
G
0

Mac OSX 10.6 or later please refer to this url:

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

Germainegerman answered 22/9, 2015 at 18:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.