Ruby
Building a Ruby App
daedalus supports Ruby apps with or without Bundler. It detects a Ruby project by
the presence of a Gemfile or a single .rb file.
Detection
| File | Strategy |
|---|---|
Gemfile |
Bundler — uses vendor/bundle/ or .bundle/config for gem paths |
Single *.rb |
Embeds Ruby interpreter, no dependency resolution |
Prerequisites
- Ruby installed (
rubyon PATH) - For Bundler projects: run
bundle installbefore building
Build
# Bundler project
daedalus build ./my-ruby-app -o my-ruby-app.de
# Single file
daedalus build ./my-script -o my-script.de
The builder:
- detects the
rubyruntime; - for Bundler projects, reads
GEM_PATHfrom.bundle/configorvendor/bundle/; - embeds the
rubyinterpreter and its shared libraries; - packages gems into the app layer;
- compresses and assembles the
.de.
Entrypoint detection
The builder looks for a main script in this order:
main.rbapp.rbserver.rbconfig.ru(Rack)config/ru(Rails convention)Rakefile
If none found, defaults to main.rb.
Bundler projects
cd my-ruby-app
bundle install --deployment # installs to vendor/bundle
daedalus build . -o my-app.de
The builder reads BUNDLE_PATH from .bundle/config and embeds the gem
directory. At runtime, GEM_PATH is set to point to the embedded gems.
Rails apps
Rails projects are detected by the presence of config/ru. The builder uses
config.ru as the entrypoint with config.ru (Rack-based startup).
cd my-rails-app
bundle install --deployment
daedalus build . -o my-rails-app.de
Environment variables
RAILS_ENV=production ./my-rails-app.de
PORT=3000 ./my-rails-app.de
Known limitations
- Only Ruby MRI is supported (not JRuby, TruffleRuby, or mruby).
- Native C extensions (gems with
.sofiles) require their system dependencies to be available on the build machine. The ELF analyzer resolves these. - Rails asset pipeline compilation must happen before
daedalus build.