On Aug 7, 2011, at 7:32 PM, CC Chen wrote:

> How to convert the script code to bin-file(Linux)?
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 


It depends on what you wish to accomplish by that. If you just want a file that can be run like a binary executable you can always set the script as executable (chmod 775 file.rb) and  put a shebang at the top:

#!/usr/bin/env ruby

Assuming you want something that can be installed and setup for the user to be run, you can still make the script executable then package it up as a gem. See the redcar gem for an example of such a setup. Another remote possibility is using JRuby to compile to java class files, throw those in a jar, then use something like launch4j as a wrapper. However that seems a bit much to achieve your goal.

Regards,
Chris White