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. - In the project, run
bundle installto update lock file. - Done.