🚀 Automatically upgrade Ruby projects to newer versions and fix deprecated code.
ruby-reforge is a gem that scans a Ruby or Rails project, detects incompatible code for a target Ruby version (e.g., upgrading from 3.1 → 3.3), and automatically rewrites or suggests fixes.
- ✅ Updates
.ruby-version,Gemfile, andgemspecfiles - ✅ Fixes deprecated Ruby syntax automatically
- ✅ Detects and fixes removed features
- ✅ Rewrites code for new Ruby syntax
- ✅ Generates detailed upgrade reports
- ✅ Interactive mode for reviewing changes
- ✅ Git integration (creates branches, commits changes)
gem install ruby-reforgeOr add it to your Gemfile:
gem 'ruby-reforge', group: :developmentruby-reforge upgrade 3.3This will:
- Update version files (
.ruby-version,Gemfile,gemspec) - Scan your codebase for deprecated patterns
- Automatically fix issues
- Create a git branch and commit changes
ruby-reforge reportShows what needs to be fixed without making changes.
ruby-reforge upgrade 3.3 --interactivePrompts before making each change.
ruby-reforge upgrade 3.3 --dry-runShows what would be changed without making any changes.
File.exists?→File.exist?Dir.exists?→Dir.exist?URI.escape→CGI.escape- And more...
- Updates
.ruby-version - Updates
Gemfileruby version - Updates
gemspecrequired_ruby_version
Detects and suggests fixes for keyword argument changes.
# Upgrade to Ruby 3.3
ruby-reforge upgrade 3.3
# Generate report for Ruby 3.2
ruby-reforge report --target 3.2
# Interactive upgrade
ruby-reforge upgrade 3.3 --interactive- Rails-specific deprecations
- Gem dependency compatibility checker
- AI-assisted fixes for complex code
- Test framework updates
- Performance improvement suggestions
Contributions are welcome! Please feel free to submit a Pull Request.
The gem is available as open source under the terms of the MIT License.