BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Ruby on Rails 8.0 Released, Introduces Kamal 2 for Improved Deployments

Ruby on Rails 8.0 Released, Introduces Kamal 2 for Improved Deployments

Recently, Ruby on Rails introduced Version 8, introducing updates aimed at simplifying deployment, enhancing performance, and reducing dependencies.

David Heinemeier Hansson, creator of Ruby on Rails and co-owner & CTO of 37signals announced the major enhancements in a blog post. Rails 8 includes Kamal 2, a deployment tool that allows developers to deploy applications to cloud VMs or on-premises servers with lesser effort. With just a single kamal setup command, developers can configure servers for production quickly. This feature uses a Dockerfile that produces production-ready container images, eliminating the need for additional web servers like Nginx.

The Dockerfile includes Thruster, a new proxy for X-Sendfile acceleration, asset caching, and compression. This further makes Rails containers internet-ready out of the box.

Kamal 2 also introduces Kamal Proxy, replacing Traefik as the default proxy. It supports zero-downtime deployments, automated SSL certificates via Let’s Encrypt, and multi-application hosting on a single server—all without complex configurations. Additionally, Kamal 2 offers built-in integrations with password managers like 1Password and Bitwarden for secure secret management and includes aliases for remote command execution.

To create an ease in regards to accessory services required for deployment, Rails 8 introduces three SQLite-based adapters. Solid Cable, which replaces Redis for WebSocket message relaying, offers in-database message storage for efficient debugging. Solid Cache utilizes disk storage to provide a cost-effective and scalable caching solution. It enables larger datasets and advanced features like encryption and retention policies. Solid Queue integrates job queuing directly into SQLite or other databases, eliminating the need for separate job-running frameworks like Sidekiq. It supports robust features like concurrency control, failure retries, and job scheduling.

Rails 8 replaces the old Sprockets system, and introduces Propshaft as its new default asset pipeline. Propshaft aligns with Rails’ #NOBUILD philosophy by simplifying asset management to two core functions: providing a load path for assets and stamping them with digests for cache-friendly expiry. This approach instils modern web development practices while maintaining backward compatibility with Sprockets for existing applications.

The tech community welcomed the Rails 8, as we saw engaging conversations on LinkedIn and Hacker News. Hansson's announcement post on LinkedIn garnered 1,308 reactions, with the community applauding rails 8 as game-changer, and no dependence on tailored hosting.

For someone who is not a Ruby Dev, one of the Hacker News community members faizshah recommended watching first half hour of Hansson's Rails World talk on Rails 8, further noting,

The idea of Rails 8 is to move away from trend following and try to reject some of the ideas that have become popular in the industry (like being afraid to touch a Linux server or implementing your own auth). Really thought provoking stuff.

From the authentication aspect, Rails 8 consolidates the authentication tools into a generator that creates a complete session-based system with password reset functionality. By running bin/rails generate authentication, developers can quickly set up essential models (e.g., User, Session), controllers (e.g., SessionsController), and mailers (e.g., PasswordsMailer). This feature simplifies secure authentication implementation without relying on third-party solutions.

Rails 8 has removed deprecated features across its components. Deprecated configurations such as config.read_encrypted_secrets and legacy methods in Active Record, like support for unregistered database adapters, are now eliminated. Additionally, deprecated behaviors in Action View, such as passing nil to form_with, are also removed.

Rails 8 has also improved security by setting default timeouts for regular expressions Regexp.timeout to mitigate denial-of-service risks.

For detailed changes, interested readers can head over to the Rails 8 changelog.

About the Author

Rate this Article

Adoption
Style

BT