An error occurred while installing rugged

For OSX if you're using homebrew:

brew install cmake 
bundle install

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

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'

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