I’ve gone down this rabbit hole, there are several options to almost achieve portability in Ruby. But making it portable and cross-platform like how Go has a single binary file has not been possible for me.
You already mentioned Traveling Ruby, but there are also:
OCRA (One-Click Ruby Application)
RubyEncoder (commercial)
DragonRuby? (It’s a game engine though)
Ruby2exe (rb2exe) but I believe it’s dead
enclose-io/ruby
Ruby-packer
portable-ruby project by homebrew
RubyMotion (costs probably)
Other ideas have been:
Using TruffleRuby (GraalVM) and compile using nativeimage
If you don’t use any gems, then maybe compile your script with opal.rb to js then bundle that js into single executable
Use your script with MRuby and enjoy the benefits of C
Run your script with JRuby and bundle the war file with warbler
Compile the Ruby script with Crystal (maybe slight modifications has to be done with your code) and use the cross compile with static flag
(Btw, running bundle install with the “—standalone” might ease with the bundling and distribution)
Quick update, I tried some of the options I provided, here's the result.
OCRA seem to have a tiny issue with some missing files (fiber.so), so there are two forks that works pretty well with Ruby scripts that is also including gems. I tried both of them on a large script and it worked pretty well. The only downside is that it only supports Windows
You already mentioned Traveling Ruby, but there are also:
OCRA (One-Click Ruby Application)
RubyEncoder (commercial)
DragonRuby? (It’s a game engine though)
Ruby2exe (rb2exe) but I believe it’s dead
enclose-io/ruby
Ruby-packer
portable-ruby project by homebrew
RubyMotion (costs probably)
Other ideas have been:
Using TruffleRuby (GraalVM) and compile using nativeimage
If you don’t use any gems, then maybe compile your script with opal.rb to js then bundle that js into single executable
Use your script with MRuby and enjoy the benefits of C
Run your script with JRuby and bundle the war file with warbler
Compile the Ruby script with Crystal (maybe slight modifications has to be done with your code) and use the cross compile with static flag
(Btw, running bundle install with the “—standalone” might ease with the bundling and distribution)