UPDATED 6 29 2015:
InfraRuby compiler and runtime for statically typed Ruby on the JVM!
I'd like to have a single binary, statically linked, out of a simple ruby crawler to build a slim docker container.
Something like what Go produces with:
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
(from Building Minimal Docker Containers for Go Applications).
Is there a way of doing this with ruby/rails?
Why bother? When you create a docker container for your ruby app you are already creating a convenient package for distribution.
I would suggest checking out the ruby and rails official images. During the container build process they will run the gem bundler in order to package dependencies.
Example
Simple ruby script project
The image is built as normal
And run as follows:
Dockerfile
helloworld.rb
Gemfile