Programming / Ruby On Rails
Completed Upgrading to Ruby 4.0.5 Using OpenCode Skills
☰
Table of Contents
Ruby Version Upgrade Completed in 10 Minutes
Previously running on Ruby3.4, I upgraded to Ruby4.0.5 today.
It took about 10 minutes. AI is intimidating.
Execution with Skills
Before performing the version upgrade, I created a skill for upgrading Ruby versions.
Here’s the beginning of the skill:
---
name: ruby-upgrade
description: Defines all procedures for Ruby version upgrades. Covers research, impact analysis, version switching, code fixes, testing, static analysis, and security checks.
---
When performing a major Ruby version upgrade (e.g., 3.4.x → 4.0.x), follow the steps in this skill.
## Workflow Overview
Research (destructive changes & impact investigation)
↓
Present investigation results → confirm with user to proceed/abort
↓
List of required modifications
↓
Check version (rbenv install --list)
↓
Modify .ruby-version
↓
(Ask user to install Ruby if necessary)
↓
Modification loop: fix one file → test → rubocop → security → review
↓
Final verification (all tests & static analysis)
↓
Commit & report
## Phase 1: Research
### 1.1 Determine Current Version and Target Upgrade Version
Check the current version from the following files:
- `.ruby-version`
- `Dockerfile`'s `ARG RUBY_VERSION`
- `Gemfile.lock`'s bundler version (indirectly)
Full skill details here
Ruby Version Upgrade Skill
Then executed the skill via OpenCode:
/ruby-upgrade Please upgrade to Ruby 4.0.5
Also Created a Rails Version Upgrade Skill
Getting carried away, I also created a Rails version upgrade skill. I haven’t tested it yet.
Rails Version Upgrade Skill
Upgrading Rails applications is one of the most challenging tasks, but having skills like this could make it easier. I think the key is the “repeat” instructions in the skill. This time I used DeepSeekV4. I’m gradually getting used to using cheaper models for looping tasks.
Comments
No comments yet.