Menu

Tree [ddec77] master /
 History

HTTPS access


File Date Author Commit
 bin 2017-06-13 Minqi Pan Minqi Pan [37dd56] add --keep-tmpdir
 lib 2017-06-20 Minqi Pan Minqi Pan [72b751] add CONFIG["RUBY_EXEC_PREFIX"] for win32
 ruby 2017-06-20 Minqi Pan Minqi Pan [ddec77] fix Dir.glob
 tests 2017-03-23 Minqi Pan Minqi Pan [2c9fba] use 2.4.1
 vendor 2017-06-12 Minqi Pan Minqi Pan [d61e87] make "make install" work
 .gitignore 2017-02-08 Minqi Pan Minqi Pan [5baaa7] simplify
 .gitmodules 2017-03-16 Minqi Pan Minqi Pan [ac7400] add test PART 2
 .travis.yml 2017-03-23 Minqi Pan Minqi Pan [2c9fba] use 2.4.1
 CHANGELOG.md 2017-03-23 Minqi Pan Minqi Pan [dffdb1] upgrade ruby runtime to 2.4.1, libsquash to htt...
 LICENSE 2017-01-22 Minqi Pan Minqi Pan [d50430] update libsquash
 README.md 2017-06-09 Minqi Pan Minqi Pan [7f65e5] Update README.md
 appveyor.yml 2017-03-23 Minqi Pan Minqi Pan [2c9fba] use 2.4.1

Read Me

Ruby Compiler

Ahead-of-time (AOT) Compiler designed for Ruby.

  • Compiling your Ruby application into a single executable
  • Rails and Native C extensions Fully Supported
  • Open Source, MIT Licensed

Travis CI status
AppVeyor status

Download

Master CI RAM Test Black-box Test Latest Stable
Windows Status Status Status https://sourceforge.net/projects/ruby-compiler/files/v0.1.0/rubyc.exe/download
macOS Status Status Status https://sourceforge.net/projects/ruby-compiler/files/v0.1.0/rubyc-darwin-x64/download
Linux Status Status Status https://sourceforge.net/projects/ruby-compiler/files/v0.1.0/rubyc-linux-x64/download

Install

Windows

First install the prerequisites:

Then download the executable rubyc.exe and run it from the Visual Studio Command Prompt.

macOS

First install the prerequisites:

  • SquashFS Tools 4.3: brew install squashfs
  • Xcode
  • You also need to install the Command Line Tools via Xcode. You can find
    this under the menu Xcode -> Preferences -> Downloads
  • This step will install gcc and the related toolchain containing make
  • Ruby 2.4.0

Then,

curl -L https://sourceforge.net/projects/ruby-compiler/files/v0.1.0/rubyc-darwin-x64/download > rubyc
chmod +x rubyc
./rubyc

Linux

First install the prerequisites:

Then,

curl -L https://sourceforge.net/projects/ruby-compiler/files/v0.1.0/rubyc-linux-x64/download > rubyc
chmod +x rubyc
./rubyc

Usage

If ENTRANCE was not provided, then a single Ruby interpreter executable will be produced.

rubyc [OPTION]... [ENTRANCE]
  -r, --root=DIR                   The path to the root of the application
  -o, --output=FILE                The path of the output file
  -d, --tmpdir=DIR                 The directory for temporary files
  -c, --clean                      Cleans temporary files before compiling
      --make-args=ARGS             Extra arguments to be passed to make
      --nmake-args=ARGS            Extra arguments to be passed to nmake
      --debug                      Enable debug mode
  -v, --version                    Prints the version of rubyc and exit
      --ruby-version               Prints the version of the Ruby runtime and exit
      --ruby-api-version           Prints the version of the Ruby API and exit
  -h, --help                       Prints this help and exit
      --examples                   Prints usage examples

Examples

Producing a single Ruby interpreter executable

rubyc
./a.out (or a.exe on Windows)

Bootstrapping

git clone --depth 1 https://github.com/pmq20/ruby-compiler
cd ruby-compiler
rubyc bin/rubyc
./a.out (or a.exe on Windows)

Compiling a CLI tool

git clone --depth 1 https://github.com/pmq20/node-compiler
cd node-compiler
rubyc bin/nodec
./a.out (or a.exe on Windows)

Compiling a Rails application

git clone --depth 1 https://github.com/ruby-china/homeland
cd homeland
rubyc bin/rails
DATABASE_URL=... ./a.out server (or a.exe on Windows)

See Also

  • Libsquash: portable, user-land SquashFS that can be easily linked and embedded within your application.
  • SquashFS: a compressed read-only filesystem for Linux.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.