Ruby is the programming language used to create Redmine so updating Ruby comes with consequences. Every time you tamper with Ruby version, make sure you have a backup so you can roll back if anything happens.
Every server is different so these steps to update Ruby are just a general guide that may or may not work for your particular server environment. This guide is for people who already have the ruby manager and bundler installed, and know what they are doing. To better understand the ruby manager, please visit the RVM documentation, and/or contact your server admin. If you don't have a server admin, RedmineX offers these services as well. Just contact us.
With that being said, to update/upgrade Ruby, you can make use of the following steps:
Back up Redmine
I can't stress this enough. Back up your file system as well as the database. Before updating Ruby, make sure all your Redmine plugins are compatible with the Ruby version you're about to install.
Upgrade Ruby Using Rvm
From Redmine root, run:
sudo rvm get stable
sudo rvm install ruby-2.7.4-railsexpress
Change the number to whatever version you want to install, based on the list of releases.
Use Ruby Version Locally Or Globally
If you want to use the Ruby version for the whole server, run:
rvm use --default ruby-2.7.4-railsexpress
If you want to use the Ruby version for the particular vhost / Redmine you're currently in, just omit --default
and run:
rvm use ruby-2.7.4-railsexpress
.
Update Ruby Gems
From Redmine root, run:
bundle update
Migrate
From Redmine root, run the migration (rake) command:
bundle exec rake redmine:plugins:migrate RAILS_ENV=production
Gemfile
You may also need to change the Ruby version in your Gemfile located in the Redmine root.
Restart
Restart Redmine. Based on your hosting provider/web server, you will need to run the following commands. Puma: sudo systemctl restart redmine.yourcompany.com.service
or Passenger: touch tmp/restart.txt
. The names of the services can vary.
Want To Get Rid Of All Tech Problems? Call Michael From RedmineX
Schedule a CallShare this if you liked it!
Take a look at our Youtube Channel.