Upgrade Rails application to Ruby 3.4.1 and Rails 8.0.4 #582
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Judge0 Rails 8.0 Upgrade
Overview
This PR upgrades the Judge0 Rails application from Ruby 2.7.0 + Rails 6.1 to Ruby 3.4.1 + Rails 8.0.4.
Architecture Decision
Ruby 3.4 is installed directly in the judge0 Dockerfile, separate from the compilers base image.
The
judge0/compilers:1.4.0base image was intentionally left unchanged.Version Summary
Changes Made
Dockerfile
bundle config set force_ruby_platform truefor native gem compilationGemfile
~> 8.0.0annotategem (incompatible with Rails 8)config/application.rb
config.load_defaults 8.0config/puma.rb
ENV.fetchto prevent crashesconfig/initializers/resque.rb
thread_safe: trueoption (deprecated in Redis gem 5.x)config/initializers/secrets.rb (NEW)
Rails.application.secrets(removed in Rails 7.1+)docker-compose.dev.yml
env_fileanddepends_onto judge0 serviceDeleted Files
lib/tasks/auto_annotate_models.rake- Referenced removed gemBreaking Changes Addressed
Testing
Verified locally with Docker:
GET /languages- 200 OK (48 languages)GET /about- 200 OK (version 1.13.1)Build Notes
First build takes ~12 minutes due to Ruby compilation. Subsequent builds use cached layers.