This is probably not what anyone who reads this title is expecting it to be.
On the other hand, there's a project on iOS, "Rubyist", that embeds mRuby and lets you actually write, parse, and execute ruby code within your app. It even has some hooks for calling into some iOS APIs (Widget APIs, most notably). It's a fun idea, but might be a dead project. https://rubyist.app
I wish there was a canonical Xcode project getting mRuby imported into an iOS/Mac app, so anyone could use it as a starting point for their ideas. I dunno, maybe one is out there and I just haven't found it?
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
On the other hand, there's a project on iOS, "Rubyist", that embeds mRuby and lets you actually write, parse, and execute ruby code within your app. It even has some hooks for calling into some iOS APIs (Widget APIs, most notably). It's a fun idea, but might be a dead project. https://rubyist.app
I wish there was a canonical Xcode project getting mRuby imported into an iOS/Mac app, so anyone could use it as a starting point for their ideas. I dunno, maybe one is out there and I just haven't found it?