Project

uprb

0.0
No release in over 3 years
uprb packs Ruby scripts into deterministic executables by freezing runtime.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

 Project Readme

uprb

Test Gem Version

uprb packs a Ruby script into a single executable with fast, deterministic startup.

The output still requires a Ruby interpreter and is tied to the Ruby and gems active at pack time. The default shebang runs Ruby with --disable-gems; flags below can change this.

Install

gem install uprb

Usage

Pack a script:

uprb pack path/to/script.rb path/to/output

Pack executables from an installed gem:

uprb gem pack GEM_NAME

Install a gem and pack its executables:

uprb gem install GEM_NAME

Options

  • -f, --force — overwrite destination
  • -r, --require LIB — pre-require LIB (repeatable)
  • --with-rubygems — embed rubygems; needed when the script references Gem::Version etc.
  • --dynamic — run the entry script at pack time to capture runtime requires. Arguments after -- become ARGV (e.g. -- --help to avoid side effects)
  • --skip-disable-gems — drop --disable-gems from the shebang (vendoring mode; gives up fast startup)
  • --skip-ruby-path-replace — keep the source shebang's ruby invocation instead of rewriting to an absolute path
  • --path DIR — destination directory (gem subcommands only)

Gemspec metadata

uprb gem pack / uprb gem install honors uprb.requires (comma-separated) in Gem::Specification#metadata as additional pre-require libraries, merged with -r:

spec.metadata["uprb.requires"] = "openssl,json"