Upgrading ShoutSMS from Rails 4 to Rails 7.1 Jul 09, 2024

Our ShoutSMS project has been cruising smoothly for the past 20 years. It has been running on Rails 4 without a glitch, but today I decided to upgrade it to the latest Rails version.

The process went surprisingly smoothly. I have to admit, the ShoutSMS service isn’t too complex in features, and the number of third-party gems is quite limited.

I started by creating a new Rails 7.1 application to use as a base. I then compared files and folders at a top level, especially remembering to copy the bin folder and files. Next, I upgraded the Gemfile by essentially copying over the new Gemfile from Rails 7.1 and patching it with the components I had.

Once I got it up and running, I used the rails app:update command, which patches files. For each file it wanted to override, I checked a diff. A good idea is to commit to your source repo before running this update, then override all files in one go and check the changes using git diff.

I used the ActiveMerchant gem, which has been heavily updated. However, since it wasn’t really needed anymore, I decided to remove it (the best way of ensuring an upgrade works 😉) and instead installed the Stripe gem to handle payments. Previously, we used PayPal for this.

âš¡

Join our community and get exclusive insights, project updates, and industry trends delivered straight to your inbox. We respect your inbox - no spam, ever.