sprockets > webpacker > sprockets > esbuild > importmapspaperclip integrations - ditch paperclip for active storagepaperclip assets to active storage will always take 5x longer than you ever thought possibleturbolinks can mess with any inline JS littered in views, rewrite as turbo-friendly stimulus controllers if you cancdn-url scripts in layouts/views - eg: jquery, ckeditorbootstrap gem + bootstrap node package. Which one is in use? Why both? Who wrote this…?rails diff is your friend https://railsdiff.org/6.1.7.4/7.0.6rails-new-output is your even bester friend https://github.com/railsdiff/rails-new-output/config/initialisers once you’ve set their version in /config/application.rbrake tasks that can mess up your data. Less code to maintainbundle outdated, bundle auditattr_encrypted once you hit rails 7.0. Migrate your 2FA keysconfig gem - use env vars for things that need changing without a full deploy (I’m looking at you Heroku), or things managed by 3rd party apps (eg heroku postgres)env specific creds where applicableaws sdk if you are only need s3 - use the s3 specific gemdiscard > paranoiahttparty for simple api interactions, instead of including a huge buggy gem, at the cost of having to maintain the api url versioning yourselfsidekiq, sidekiq-cron > wheneverslim > hamlwkhtmltopdf on heroku? There’s a wkhtmltopdf-heroku specific gem that worksreviewdog + brakeman > travis + brakemanffaker > faker - should only be a few differences to fixpagy > all other pagination gemspundit is great for locking down granular access to thingsphonelib is great for phone/mobile sanitise/formattingpg_search is handy for postgres full text searchpaper_trail (gem) != papertrail (saas) - tracking changes like audited vs online log storagecoffee-rails, use an online service to decaffinateuglifier, yui-compressor etc once you have webpacker packaging the FEletter_opener is your friend on local dev. If you absolutely must test on an smtp server, add some sandbox email intercepting so you don’t email real people. Friends don’t let friends spam. But you use obfuscated data, right?yarn over npm - should have a yarn.lock in the rootyarn outdated, yarn auditnode versions 10>12>14>16>18>20 up to the oldest your hosting platform supports - new ones are always fiddly and will probably make you sob uncontrollably.openssl 1.1.1, and can’t go above node 18/20 without using the openssl-legacy-provider node option - sorted in ruby 3.1 which uses openssl 3libv8 / therubyracer gems as you have node installedbootstrap, font awesome, jquerypurgecss can help remove unused css - but sometimes it gets it wrong, add exceptions to /config/purgecss.config.jsbower. Move them to package.json and let yarn take over.node-version in the root - if you don’t, travis will assume the latest for it’s ubuntu version, which may throw errors around node18/20, openssl1/3.ruby-versionubuntu 22 / jammy for >= ruby 3.1 apps - no openssl 1.1.1ubuntu 20 / focal for node 20, but with openssl-legacy-provider to use openssl 1.1.1postgres 15, you’ll have difficulties trying to get it working. Just use postgres 12 in your travis config and save hrs of fucking around which you know in your heart of hearts you’ll never get back. In celebration of the time you’ve just saved, plant a garden or do something nice.heroku-20 / focal for apps < ruby 3.1heroku-22 / jammy for apps >= ruby 3.1Gemfile, /configstdout and let heroku manage the logs - and maybe pipe to papertrail for a better uiIf you’re stuck on a Rails upgrade, give us a shout! If you’d like to complain about the mixing up of metaphors, lame movie references, or anything that’s rustled your jimmies please head over to our Linkedin and leave a complaint there. We value the feedback.
Most Rails update guides are just sad regurgitations of rubyonrails.org guides.
Not this one.
Make a cup of tea, strap yourself in and get ready - this is the unvarnished, definitive guide. We've already wasted all the time there is and been down all the rabbit holes there are, so you don't need to!
So nice. 👍
Clem Fandango
-
18 Sep 2023
Let's build something awesome together
Hire us