From: Michal Suchanek Date: 2010-05-23T20:28:23+09:00 Subject: Ruby one-file launcher that sets up environment? Hello I am trying to run some JRuby script and I have to set the CLASSPATH for my script to work. I use a launcher locally so I can run the script as ./scripts/mylauncher script.rb but if I wanted to distribute a sample script this is somewhat troublesome. I tried to embed the ruby code in a shell script but as Ruby refuses to read the code from stdin this is not quite nice: #!/bin/sh CLASSPATH= jruby -e ' ' "$@" Note that while this example uses JRuby there might be native extensions which require specific environment settings and woud have the same launcher requirements. If somebody had a better idea for a launcher it would be nice. Thanks Michal