Skip to content

Ruby Update

Henne Vogelsang edited this page Mar 10, 2022 · 12 revisions

Ruby Update

How to make a Ruby version update happening.

Code

Interpreter location

Find (grep -Hril ruby.ruby2.5) and replace all interpreter locations you find for the old version with the new version.

Development Environment

Install the new ruby interpreter in your dev-env and try to boot the app. Fix any problems...

docker-compose run --rm --service-ports frontend /bin/bash -l
...
frontend@4757397d3caa:/obs/src/api> sudo zypper rm '*ruby*'
...
frontend@4757397d3caa:/obs/src/api> sudo zypper in ruby4.0-devel
...
frontend@4757397d3caa:/obs/src/api> bundle.ruby3.1 -v # Set this in Gemfile.lock "BUNDLED WITH"
...
frontend@4757397d3caa:/obs/src/api> bundle.ruby3.1 install
...
frontend@4757397d3caa:/obs/src/api> bundle.ruby.ruby3.1 exec rails c
...

Packaging

Ruby Interpreter Package in OBS:Server:Unstable

Project Configuration in OBS:Server:Unstable

There is a ruby configuration section at the bottom of the prjconf. It defines which ruby version the rubygem packages in O:S:U are built for. We only ever build things for one ruby version.

  • Adopt all the versioned macros
  • rebuild of the rubygem packages, make sure they succeed

OBS packages

Adopt the version in

  • dist/obs-server.spec
  • dist/obs-bundled-gems.spec

Deployment

build-test.opensuse.org

Once obs-api is built, our test instance will automatically install it.

You need to adopt some files:

  • Update the ruby version in /etc/apache2/conf.d/mod_passenger.conf
  • Update the ruby version in /root/.bashrc

Once this works, move on to production.

Productions

Repeat what you had to do on the test instance. Good luck!

Clone this wiki locally