Page 56 of 173

Gitlab CI Runner + RVM for projects that you want to build

Allowing Gitlab CI Runners to use RVM is really easy:

# Login as a super user (or use sudo)
su
# Switch to gitlab CI runner user
su - gitlab_ci_runner
# Go to his home directory
cd ~
# And install RVM
\curl -sSL https://get.rvm.io | bash -s stable --ruby
# Now go back to su
exit
# And restart (just in case) gitlab and ci
/etc/init.d/gitlab restart
/etc/init.d/gitlab_ci restart

That's all. Just keep in mind, that each time you want a new Ruby version, you will have to login as gitlab_ci_runner and install it from console.

Ruby – Installation and compilation from sources on Debian

If you don't want to use Ruby from your repositories and you don't want (or can't because of some reason) to use RVM, here's a quick howto download and compile Ruby from sources (all the commands should be executed with sudo or as a super user):

First a small update and some neccessery libs:

sudo su
apt-get update

# Not sure if all of them are required but nothing bad will happen if you just install them

apt-get install build-essential bison openssl libreadline6 libreadline6-dev \
libyaml-dev libxml2-dev libxslt-dev zlib1g zlib1g-dev libssl-dev autoconf \
libc6-dev ncurses-dev libaprutil1-dev libffi-dev libcurl4-openssl-dev libapr1-dev

Then we should go here and download the most recent stable version:

# Still as root
cd ~
wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.gz

Of course we need to unpack it:

tar -xvf ruby-2.1.2.tar.gz
# go to where it was unpacked
cd ruby-2.1.2/

and now the whole installation process:

./configure  
make  
make test  
make install 

and a small cleanup:

cd ~
rm -rf ruby-2.1.2*

To test it, just:

ruby -v
# output: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]

Copyright © 2025 Closer to Code

Theme by Anders NorenUp ↑