Update: This is just an experiment I did in 2011, if you're trying to compile Ruby to JavaScript today, be sure to visit the Opal project This is a gem intended to convert Ruby scripts into JavaScript code executable on any browser.