Yet another "convert ruby script into a portable executable" tool

Hi guys,

I was struggling to find a tool to convert my ruby scripts into portable executable apps. I tried a lot of solutions (crate, releasy, etc) but none of them seemed to work. They are or too complicated for my taste or just broken. So, I wrote my own tool:

It supports Rails and Gemfile, btw. It doesn’t compile nor obfuscate the code: it just packages a stand-alone ruby interpreter, plus your project/script, into a self-extracted, self-executable file. This allows to easily distribute and execute the app on machines that don’t have a ruby installed.

I wrote it for my own needs, so it can be considered “limited” for someone purposes, but I’m sharing it here as an alternative.

In case anyone wants to hack it or understand its internals, I also wrote a step-by-step guide:


And here are some usage examples:


gem install rb2exe

Example I - Simple script:
echo “puts ‘Hello world’” > test.rb

rb2exe test.rb

Hello world


Example II - Multi source project:
mkdir test
cd test
echo “STR = ‘Hello world’” > a.rb
echo “load ‘a.rb’” > main.rb
echo “puts STR” >> main.rb

rb2exe main.rb --add=.

Hello world


Example III - Gemfile support:

mkdir test
cd test
echo “source ‘’” > Gemfile
echo “gem ‘faker’” >> Gemfile
echo “require ‘faker’” > a.rb
echo ‘puts “Hello #{}”’ >> a.rb

rb2exe a.rb --add=.

Hello Abbigail Okuneva


Example IV - Rails support:

rails new myproject
cd myproject

rb2exe --rails

=> Booting Puma

=> Rails application starting in production on

=> Run rails server -h for more startup options

Puma starting in single mode…

* Version 3.6.0 (ruby 2.2.2-p95), codename: Sleepy Sunday Serenity

* Min threads: 5, max threads: 5

* Environment: production

* Listening on tcp://

Use Ctrl-C to stop


Example V - OSX binary:
rb2exe test.rb --target=osx


I’d be interested in using this, but the fact that you made it require Ruby version 2.2.2 is a downfall, as I use 2.3.1 How might I make this work with 2.3.1?

Hi Jesse,

Rb2exe project uses Traveling Ruby (TR) binaries:

And unfortunately, it has been 3 years since their last update.

BTW, rb2exe is just a packer for TR. If you use TR, you will end up with a folder with many files. Rb2exe just packs everything into a single auto-executable zipped file.

To update rb2exe with a most recent ruby version, it will be necessary to find another standalone ruby binary. I think it’s possible to either use Ruby Ship or to update Traveling Ruby by reproducing the same steps they have used (link here).

I wish I had more time to update it, but anyways please feel free to contribute.