Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLab Hosted Ruby Version Issue

I'm testing out a simple Rails project with hosted GitLab. My repository has Ruby version 2.3.0 and Rails version 5.0.1. I created the basic gitlab-ci.yml file with the below code for CI. When GitLab goes to run this file through the pipeline to add it I get the error:

activesupport-5.0.1 requires ruby version >= 2.2.2, which is incompatible with the current version, ruby 2.1.10p492

I'm not sure how to change the version of Ruby that GitLab is using. Any suggestions on how to resolve this issue?

gitlab-ci.yml

before_script:
  - apt-get update -qq && apt-get install -y -qq sqlite3 libsqlite3-dev nodejs
  - ruby -v
  - which ruby
  - gem install bundler --no-ri --no-rdoc
  - bundle install --jobs $(nproc)  "${FLAGS[@]}"

rspec:
  script:
    - bundle exec rspec

rubocop:
  script:
    - bundle exec rubocop
like image 342
Aaron Lind Avatar asked May 22 '26 18:05

Aaron Lind


1 Answers

You define the environment in which the code is run by using a Docker image.

Try adding

image: ruby:2.3.0

to the top of your .gitlab-ci.yml file

like image 182
Max Woolf Avatar answered May 24 '26 08:05

Max Woolf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!