Ship a Ruby app to people who don't have Ruby.
Fledge builds the Ruby program you run, its project, and the gems its Gemfile.lock locks into an app that carries a Ruby: a folder that runs on macOS, Windows, or Linux with nothing installed, and a project Xcode or Gradle builds into an iPhone or Android app. The app runs your program as bundle exec ruby would, so the program you test is the program you ship, and it calls nothing of Fledge's. It's for a developer with a working Ruby program, a command-line tool, a game, or a desktop app, who wants to hand it to people who will never install Ruby.
How it compares with what you may have tried:
gem installreaches only people who have Ruby, the right version of it, and a compiler for any gem that needs one. A Fledge app needs none of those.- Tebako packs an app that downloads its Ruby the first time it opens on a computer, into
~/.tebako, a folder in the person's home that every Tebako app there shares. A Fledge app carries its Ruby, so it needs no network to start. - OCRAN packs an app and the Ruby the developer runs into one executable file, which unpacks into a temporary folder each time it starts. A Fledge app is a folder that starts as
rubystarts, and a windowed app gets the installers each system expects. - Copying your Ruby fails on another computer: a Ruby from a version manager or a package manager records the absolute paths it was built for, and links the libraries of the computer that built it. A Fledge runtime is built to run from any folder.
A two-line program, main.rb, in a folder named greet:
name = ARGV.first || "world"
puts "Hello, #{name}!"With Fledge in the project's Gemfile, build it on Linux:
$ bundle exec fledge build
Downloading fledge-runtime-0.17.0-x86_64-linux.tar.gz from https://github.com/setdef/Fledge/releases/download/v0.17.0
Writing the gems' executables for x86_64-linux
dist/Greet-x86_64-linux.tar.gzThen unpack it anywhere, and run it with an environment that holds no Ruby:
$ tar -xzf dist/Greet-x86_64-linux.tar.gz -C /tmp
$ env -i PATH=/usr/bin:/bin /tmp/Greet-x86_64-linux/Greet Ada
Hello, Ada!The tutorial goes on from there: naming the app, adding gems, and handing it over.
| Platform | Runs on | Built on | You hand people |
|---|---|---|---|
| macOS | macOS 26.0 and later, on Apple silicon | a Mac with Apple silicon | a .tar.gz, and a .dmg for a windowed app |
| Windows | Windows 11 and later, on x64 or ARM64 | Windows 11 on the same processor | a .zip, and a setup program or an MSIX package for a windowed app |
| Linux, glibc | glibc 2.28 and later, on x86-64 or ARM64 | Linux on the same processor | a .tar.gz, and an AppImage or a .deb for a windowed app |
| Linux, musl | musl Linux, such as Alpine, on x86-64 or ARM64 | musl Linux on the same processor | a .tar.gz, and an AppImage for a windowed app |
| iOS and iPadOS | 15.0 and later | a Mac with Apple silicon, with Xcode and XcodeGen | an Xcode project, which you build and sign |
| Android | 8.0 (API 26) and later | a Mac with Apple silicon, x86-64 Linux, or x64 Windows | a Gradle project, which you build and sign |
Each platform's app is built on a computer of that platform: to ship for three desktops, build on three computers, or on three of a CI service's runners. Every app carries Ruby 4.1, and you build with Ruby 4.1. Windows 10, a Mac with an Intel processor, and 32-bit systems are not among Fledge's platforms. Platforms has the details, and what each build computer needs.
Fledge is a gem, installed from its release tag on GitHub. Add it to the project's Gemfile:
gem "fledge", github: "setdef/Fledge", tag: "v0.17.0"Then run bundle install with Ruby 4.1. Bundler fetches a gem from GitHub with Git, so git has to be on your PATH, and compiles bigdecimal, which Fledge's KDL reader needs, so a C compiler has to be there too: Xcode's command line tools on macOS (xcode-select --install), gcc and make on Linux, and RubyInstaller's MSYS2 toolchain (ridk install) on Windows.
On macOS or Linux, a version manager installs Ruby 4.1: with mise, run mise use ruby@4.1.0-preview1. On Windows, install the head build of RubyInstaller, rubyinstaller-head, the Ruby 4.1 that Fledge's Windows runtime is made from.
In your project's folder, build the app for the computer you're on:
$ bundle exec fledge buildfledge prints the path of each file it wrote, in dist, and writes each one's SHA-256 beside it. From there:
-
Say how the app presents itself in a
fledge.kdlbeside theGemfile: its name, version, icon, and, for a desktop app, that it opens windows. Every line is optional.name "Cool App" version "1.2.3" kind windowed identifier "com.example.CoolApp" icon "icons/app" installers dmg nsis appimage
A windowed app gets a macOS bundle and disk image, a Windows setup program, and a Linux desktop entry and AppImage. See Make a windowed app, and the fledge.kdl reference for every node.
-
Ship gems with C extensions. fledge compiles them for the app's Ruby, and refuses one whose compiled file couldn't load on another computer, saying what to change. See Ship gems with C extensions.
-
Sign the app for macOS and Windows, and have Apple notarize it:
$ bundle exec fledge build --sign "Developer ID Application: Example, Inc. (ABCDE12345)" --notarize notary -
Build on each platform you ship for, and hand people the archive or installer each build printed.
-
Write the phone apps' projects, on a Mac for iOS, and build them with Xcode or Gradle:
$ bundle exec fledge ios project $ bundle exec fledge android project
- The tutorial: build a command-line tool into an app, from nothing.
- How-to guides: windowed apps, file associations, several programs, native gems, private gem servers, smaller apps, signing, phones, and building offline.
- The
fledgecommand: every command, flag, environment variable, and exit status, as a Usage spec. - fledge.kdl: every node of the file that says how an app presents itself.
- Platforms and what a built app holds.
- How Fledge works and Ruby on a phone: why an app is shaped as it is.
- The changelog: what changed in each release.
Ask questions, and report bugs, on the Fledge forum. Include the Fledge version (bundle exec fledge --version), the systems you built on and ran on, the project's fledge.kdl, the command you ran, and everything it printed. Report a vulnerability privately, as the security policy says.
CONTRIBUTING.md has the project's rules, setup, and checks. Fledge's design maps its parts for anyone changing them.
Fledge is released under the MIT License, copyright setdef.
Your app's code is yours to license as you choose. The app carries Fledge's runtime, whose parts keep their licenses; each app holds their notices in its notices folder, and the release publishes the source of each LGPL part. The gems your app depends on are your choice, and their licenses yours to comply with. What ships inside an app, and what its licenses ask of you lists each component of the runtime and what its license asks of you.
I use four words for how code and prose comes to exist. Code or prose I wrote, I typed by hand, with nothing generated. Code or prose I wrought, an AI agent generated while I iterated with it, and I reviewed every change before committing it, so I own every diff. Code or prose I requested, an agent built with little or no review from me, but I take ownership of the outcome or product because I tested and iterated. Code or prose I rushed, an agent built with little or no feedback from me, and may or may not be useful (or safe).
Fledge's code, tests, and documentation, this README included, were requested. Agents built them from my goals and decisions, with little review of the diffs. In place of review, the project's rules require every change to pass its gates with zero errors and zero warnings: the unit and integration tests, RuboCop, Steep's type checks, RubyCritic, and reuse lint. They also require each desktop platform's built app to run on a fresh computer that has never had Ruby. declare-ai.org.