- Documentation
- Technologies
- Ruby
Ruby
Guara Cloud fully supports Ruby applications, including frameworks like Ruby on Rails, Sinatra, Hanami, and any Rack-based application.
Supported versions
The following Ruby versions are auto-detected:
- Ruby 3.1
- Ruby 3.2
- Ruby 3.3
The version is auto-detected from your Gemfile or .ruby-version file.
# Gemfile
ruby '3.3.0'
Deploy with Dockerfile
For full control over your build, provide a Dockerfile in the root of your repository.
Deploy with Buildpack
If your repository does not contain a Dockerfile, Guara Cloud automatically detects your Ruby project by the presence of a Gemfile.
The auto-detection will:
- Detect the Ruby version from
Gemfileor.ruby-version - Run
bundle install - Detect Rails applications automatically, enabling jemalloc and bootsnap for optimized performance
- Precompile the asset pipeline if a Rails app is detected
- Auto-configure Puma as the application server
Port configuration
Your application must listen on the port configured in your service settings. The default is 3000, but you can change it at any time to match your application.
port = ENV['PORT'] || 3000
For Puma, configure it in config/puma.rb:
port ENV.fetch('PORT') { 3000 }
Example project structure
my-rails-app/
Gemfile
Gemfile.lock
Procfile
config.ru
app/
controllers/
models/
views/
config/
puma.rb
Dockerfile # optional — omit to use Buildpack
Environment variables
These environment variables are commonly used with Ruby deployments:
| Variable | Recommended value | Description |
|---|---|---|
RAILS_ENV | production | Sets the Rails environment |
RACK_ENV | production | Sets the Rack environment for non-Rails apps |
PORT | Set by platform | The port your application must listen on |
SECRET_KEY_BASE | Your secret | Required by Rails for encrypted cookies and sessions |
RAILS_LOG_TO_STDOUT | enabled | Sends Rails logs to stdout for visibility |