A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/kontena/ruby-packer below:

kontena/ruby-packer: Packing your Ruby application into a single executable.

Forked from pmq20/ruby-packer

Packing your Ruby application into a single executable.

It takes less than 5 minutes to compile any project with Ruby Compiler.

You won't need to modify a single line of code in your application, no matter how you developed it as long as it works in plain Ruby!

For previous releases, cf. http://enclose.io/rubyc

First install the prerequisites:

Then,

curl -L http://enclose.io/rubyc/rubyc-darwin-x64.gz | gunzip > rubyc
chmod +x rubyc
./rubyc --help

First install the prerequisites:

Then,

curl -L http://enclose.io/rubyc/rubyc-linux-x64.gz | gunzip > rubyc
chmod +x rubyc
./rubyc --help

First install the prerequisites:

Then download rubyc-x64.zip, and this zip file contains only one executable. Unzip it. Optionally, rename it to rubyc.exe and put it under C:\Windows (or any other directory that is part of PATH). Execute rubyc --help from the command line.

If ENTRANCE was not provided, then a single Ruby interpreter executable will be produced. ENTRANCE can be either a file path, or a "x" string as in bundle exec "x".

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-tmpdir               Cleans temporary files before compiling
      --keep-tmpdir                Keeps all temporary files that were generated last time
      --openssl-dir                The path to openssl
      --make-args=ARGS             Extra arguments to be passed to make
      --nmake-args=ARGS            Extra arguments to be passed to nmake
      --auto-update-url=URL        Enables auto-update and specifies the URL to get the latest version
      --auto-update-base=STRING    Enables auto-update and specifies the base version string
      --debug                      Enable debug mode
  -i, --ignore-file                Ignore file(s) from build
  -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

rubyc compiles its own version of openssl without any certifications. To be able to use ssl with rubyc it should know where to find the certifications.

By default this path is set to /usr/local/etc/openssl/ but can be overridden using the --openssl-dir argument.

Keep in mind that users running your compiled package should have their certifications present in this directory as well.

If you don't want certain files included in the build you can ignore them from the command line using -i.

rubyc -i ignore.file -i ignore-2.file -i "ignore*"

Alternatively you can create a .rubycignore file in the root of your project to specify which files should be ignored.

Producing a single Ruby interpreter executable
rubyc
./a.out (or a.exe on Windows)
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 Rails application
rails new yours
cd yours
rubyc bin/rails
./a.out server (or a.exe server on Windows)

Note that some gems that use C extensions that use libc IO to load files from your Rails application will not work with rubyc. Notably, bootsnap will not work with rubyc.

rubyc --gem=bundler --gem-version=1.15.4 bundle
./a.out (or a.exe on Windows)

To build rubyc you must have a C compiler and the necessary toolchain to build ruby and the libraries stuffed inside rubyc which include at least:

If you are unsure if your toolchain is complete then trying to build rubyc will let you know you are missing something. Unfortunately it may tell you with some unfamiliar message. Please file an issue here if this occurs.

Once your toolchain is set up run bundle. To compile your own rubyc run:

Or:

rm rubyc; ruby -Ilib bin/rubyc bin/rubyc -o rubyc

Remember that rubyc includes all the files from the current directory in the built executable. You must delete the prior rubyc or your squashfs will continually grow larger and the embedded squashfs compile time will be very, very long.

If you make changes to the stuffed libraries or the compiler you may need to add the --clean-tmpdir argument to rubyc for a clean rebuild.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4