fly-rails gem to deploy your Rails applications to Fly.io using Rails commands.
Please note that the fly-rails gem is designed to work well with common Rails production configurations, like a Turbo app that uses Sidekiq, AnyCable, Redis, & Postgres. For less common configurations, we recommend using flyctl and its respective configuration files to manage your deployment.
Install the flyctl command line interface
First you’ll need to install the Fly CLI, and signup for a Fly.io account. The gem used in the next step will use this CLI to deploy your application to Fly.io and it’s something that’s worth learning more about as you become more comfortable with Fly.io.
Install the gem
Add thefly-rails gem from the root of your Rails project.
fly-rails gem in your Rails project, which adds commands to Rails that make deploying apps to Fly.io require less steps.
Launch your app
The first deployment will both provision and deploy the application to Fly.io. Run the following command:Deployments
Changes to your application can be deployed with one command.Ejecting
There may be a point where you need to “eject” from thefly-rails gem for deployments that require more advanced configuration. Ejecting creates a fly.toml and Dockerfile at the root of your project that works with flyctl and gives you full and exact control over your application configuration.