Paul Krill
Editor at Large

Ruby on Rails streamlines deployment with Kamal 2

news
Sep 27, 20243 mins

Ruby on Rails 8, now in beta, comes preconfigured with Kamal 2 for fast and easy deployment in a Docker container to any Linux system.

closeup of train wheels on railroad track steam locomotive red wheels with white trim
Credit: Pedal to the Stock / Shutterstock

Ruby on Rails 8, the latest version of the well-known web app framework for the Ruby programming language, has reached the beta stage. The update promises to make deployment of Rails web apps friendly and usable, without developers needing to rely on a platform-as-a-service (PaaS) cloud setup.

The Rails 8 beta was unveiled September 27. Instructions on installing Rails can be found at rubyonrails.org.

Featured in Rails 8 is the Kamal 2 web app deployment system. Rails 8 comes preconfigured with Kamal 2, enabling fast and easy deployment of Rails applications in Docker containers to any Linux system. Regardless of whether the application is being deployed to a cloud VM or a developer’s own hardware, Kamal turns a Linux box into an application server or accessory server via a kamal setup command. “All Kamal needs is the IP addresses for a set of servers with your SSH key deposited, and you’ll be ready to go into production in under two minutes,” Ruby creator David Heinemeier Hansson wrote in a blog post announcing the release.

Kamal is able to perform this operation because Rails is equipped with a Dockerfile for turning an application into a container image, Heinemeier said. With Rails 8, the Dockerfile has been upgraded to include a proxy, called Thruster, which sits in front of the Puma web server to offer X-Sendfile acceleration, asset compression, and asset caching. Thus, there is no need to put an Nginx server or other web server in front. Also featured in Kamal 2 is Kamal Proxy to replace the generic Traefik option at launch. This proxy offers fast zero-downtime deploys, automated SSL certificates, and support for multiple applications on one server without a complicated configuration, according to the Rails bulletin on Rails 8.

Also in Rails 8, database-backed adapters enable usage of SQLite for features such as caching, WebSockets, and jobs. And Solid Cable, a database-backed Action Cable adapter, replaces the need for Redis to act as a pubsub server to relay WebSocket messages from the application to clients connected to different processes. And Solid Cache, a database-backed Active Support cache store, replaces the need for Redis or Memcached for storing HTML fragment caches, in particular. Solid Queue, meanwhile, a database-backed Active Job back end, means there is no need for Redis and a separate job-running framework, such as Sidekiq or Delayed Job, for most persons.

On the security front, Rails 8 puts pieces together for a complete authentication system generator, creating a starting point for a session-based, password-resettable, metadata-tracking authentication system. Rails 8 also features work to make the SQLite adapter and Ruby driver suitable for production use. And Propshaft becomes the default asset pipeline, replacing the Sprockets system, which dates back to 2009.

Rails 8 was preceded by Rails 7.2, which arrived August 10 and featured improved production defaults for building more-efficient applications.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author