Ruby is another very popular programming language used not only for web applications (that is, in the Ruby on Rails framework), but also for general scripting.
Apache Thrift's compiler has a limited number of special options for Ruby; there are only two. Run the following command to see them:
$ thrift --help
Look for the information about Ruby generators:
rb (Ruby): rubygems: Add a "require 'rubygems'" line to the top of each generated file. namespaced: Generate files in idiomatic namespaced directories.
Let's explain both of them:
rubygems
: As the description states, it just adds therequire 'rubygems'
line on top of each file that is generated by the compiler.namespaced
: The files that are generated are put in the directories with the names of the namespaces which you selected.
If you need both options, you can combine them:
$ thrift --gen rb:rubygems,namespaced myfirst.thrift
Watch out, because you won't get any error message if you misspell...