Rails 7.2 brings updates for Dev Container, compilation and documentation
The web framework for the Ruby programming language now requires Ruby 3.1 and introduces new options for development containers.
(Image: Bild erzeugt mit KI)
The development team behind Ruby on Rails has released the new minor version Rails 7.2. Almost 2500 commits have been incorporated into the most important web framework for Ruby developers. Among other things, they bring innovations for handling development containers, current Ruby versions and Ruby's JIT compiler YJIT.
Rails 7.2 is a minor release of the seventh major version, which was released in December 2021 with a focus on full-stack development and a Node.js-free approach. Since then, there has also been a free choice of bundler, after this was previously limited to webpack.
Videos by heise
Configuring development containers
Development Containers (Dev Containers) are available in Rails to use containers as a development environment with complete features. They can be used – locally and in public or private clouds – to run applications and separate tools, libraries or runtimes that are required for a code base.
The new Rails version now allows you to create a dev container configuration for an application. It includes a .devcontainer folder with a Dockerfile, a docker-compose.yml file and a devcontainer.json file. By default, a dev container contains a Redis container, a database, a headless Chrome container for system tests and Active Storage.
A new application including a dev container can be created as follows:
$ rails new myapp --devcontainer
For existing applications, the new devcontainer command can be used:
$ rails devcontainer
The documentation provides further information on using Dev Containers.
The development team is also working on clearer documentation. So far, the updates are limited to the Edge Guides, which refer to the current master branch for Rails. Once the final changes have been completed, the updates will be extended to the guides for stable versions of Rails 7.
The layout of the guides will remain the same, but they will feature a reduced design, simplified navigation and a pinned Chapter navigation bar when scrolling, among other things.
(Image:Â Ruby on Rails)
Saying goodbye to Ruby legacy
The new Rails release requires Ruby version 3.1 or higher. Previously, only major versions of Rails removed compatibility with older versions of the programming language. This is now changing, as Ruby versions that have reached their end-of-life date are no longer supported in minor versions of Rails.
(Image:Â ruby-lang.org)
Information about the lifecycle of Ruby versions can be found on the official Ruby website. According to this, the end-of-life date for version 3.1 is scheduled for March 31, 2025.
There are also new features for dealing with YJIT – Ruby's JIT compiler, which has been available in Ruby since Ruby 3.1 and is said to enable a latency improvement of 15 to 25 percent. Anyone using Ruby 3.3 or newer will now find YJIT enabled by default in Rails 7.2. The compiler can be deactivated via Rails.application.config.yjit = false.
All other updates in Rails 7.2 can be found in a blog entry and the release notes.
(mai)