Traveling Ruby 20150210: smaller, supports Ruby 2.2, Windows

Traveling Ruby allows you to create self-contained, "portable" Ruby binaries which can run on any Windows machine, any Linux distribution and any OS X machine. This allows Ruby app developers to distribute a single package to end users, without needing end users to first install Ruby or gems.

We've released version 20150210, which marks a major milestone. It introduces Windows support, and support for Ruby 2.2.

Backstory

There's a little bit of a backstory behind this release.

Last week I went to Amsterdam.rb's MRI Implementors Panel meetup featuring Koichi Sasada, Terence Lee and Zachary Scott. Distribution of Ruby apps came up at some point. Terence and Koichi talked about the fact that MRuby -- an alternative Ruby implementation that Yukihiro Matsumoto is working on -- is able to precompile Ruby apps into a single self-contained binary with no dependencies. They asserted that the ability to produce such a binary is the reason why so many people are moving to Go: it makes deployment and distribution much easier. But I was unconvinced about the value of MRuby, because MRuby is a subset of Ruby. In my opinion, Ruby's main power lies in its standard library and its rich ecosystem.

So I talked with Terence and with Eloy Durán (MacRuby/RubyMotion) about Traveling Ruby. Traveling Ruby is different in that it's just a normal MRI Ruby interpreter, and not a subset of the language with limitations. You can even use many native extensions. However, Terence and Eloy were equally unconvinced, asserting that Traveling Ruby doesn't support Windows, and can't produce a single binary. Traveling Ruby currently generates a self-contained directory with no dependencies. This directory contains a single wrapper script plus a lib subdirectory that contains the bulk of the app, so it looks almost like a single self-contained binary. But that's not good enough for them.

Then we contemplated how sad it is that so many parties are moving off Ruby towards Go.

So I implemented Windows support last weekend. This is just a minimum viable product: at present, there are lots of caveats and limitations in the Windows support. In a future release, I plan on introducing the ability to produce a single self-contained binary.

Although some people within Phusion are big Go fans, I am personally a big Ruby fan. I am in love with Ruby's simplicity, elegance and productivity. There are high-quality libraries for almost every task imagineable. The only things Ruby isn't good at are tasks which require very low memory consumption or very high performance, but most of the problems I'm solving do not require either. So with the continued development of Traveling Ruby, I am hoping that I can prevent more people from switching to Go due to distribution issues, or even switch some people back.

Changes

Ruby 2.2.0

Previous Traveling Ruby versions used Ruby 2.1.5. But we now also support Ruby 2.2.0 in addition to 2.1.5. In the future we may drop support for 2.1.5, but for now both versions are supported at the same time. You may be interested in Ruby 2.2 because of the better garbage collector and performance characteristics.

Windows support

We now support creating Windows packages. But there are currently a number of caveats:

  • Traveling Ruby supports creating packages for Windows, but it does not yet support creating packages on Windows. That is, the Traveling Ruby tutorials and the documentation do not work when you are a Ruby developer on Windows. To create Windows packages, you must use OS X or Linux.

    This is because in our documentation we make heavy use of standard Unix tools. Tools which are not available on Windows. In the future we may replace the use of such tools with Ruby tools so that the documentation works on Windows too.

  • Only Ruby 2.1.5 is supported for Windows, not 2.2.0. This is because the RubyInstaller project hasn't released Ruby 2.2.0 binaries yet.

Gem upgrades and other changes

  • Fixed a problem with the 'rugged' native extension on Linux. Closes GH-33.
  • Fixed a problem with the 'charlock_holmes' native extension on Linux. Closes GH-34.
  • Header files are no longer packaged. This saves 256 KB.
  • RDoc and various unnecessary Bundler files have been removed. This saves about 1.2 MB.
  • Upgraded Bundler to 1.7.12.
comments powered by Disqus