creates a standalone ruby directory from a ruby script
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.




edvakf (




Copyright (C) edvakf, 2011. All rights reserved


Distributed under the same license as Ruby

What is?

RBat makes distribution of ruby script to windows easier.

RBat copies Ruby and all dependensies under current directory, and creates a batch file that executes a script.

In theory, the directory should be standalone, ie. running the batch file should run the ruby script on the Ruby under this directory.

RBat is inspired a lot by Exerb.


  • Write your ruby script on Windows

  • Download rbat.rb on the directory of your script

  • Ruby your script with mswin or mingw Ruby (not cygwin) requiring rbat.rb as follows

> /path/to/ruby -r./rbat ./your-script.rb

  • This will create a directory called 'ruby-dist' and copy ruby executable etc. It also creates your-script.bat in the current directory.


Scripts that require rbconfig might not work properly.

At the moment, rbat copies ALL *.dll files in the same directory as Ruby executable, even unused ones. This is because there is no easy way to tell which dll is loaded by Ruby.


However, I created another library called dll.rb which is still not well tested at all, and might not work in other than my environment, but can lists all .dll and .so files that are loaded by the current Ruby program.

> /path/to/ruby -r./dll ./your-script.rb

The dlls which are in the same folder as Ruby itself are the ones that are used. Those that are not listed are the ones unused. If there are dlls that are in ruby-dist directory and are not listed here, then you can probably remove them.