Updating Ruby cheatsheet
• 🖊 Felipe Bojorquez • 🏷 software, code
Although rbenv makes managing multiple Ruby versions straightforward, I’ve found that updating Ruby for active projects still involves a handful of important steps. Forgetting one of them sometimes leads to confusing dependency issues or mismatched versions. For this reason, I put together a concise checklist of the commands I use when upgrading Ruby.
Whenever a new version of Ruby comes out and I want to update my project and coding environment, I run:
rbenv install -lto list latest stable versions available.rbenv install x.y.zinstall selected version.rbenv global x.y.zset global version to use.- Update
Gemfileto new version number in the project. - Update
.ruby-versionto new version number in the project. - Run
gem install bundlerto install the latest version, appropriate for the just installed Ruby version. - Delete the lock file of the project to regenerate it.
- In the project, run
bundle installto update lock file. - Done.
Update February 12th, 2026: I have found that deleting the
.lockfile of the project before runningbundle installand starting fresh has helped me when troubleshooting the Ruby version of a project, so I added it as step #7.