Raghu Go wrote:
> How do I compress a string in ruby?
>   

Here's one way:

require "zlib"

Zlib::Deflate.deflate("a string")

See http://ruby-doc.org/stdlib/libdoc/zlib/rdoc/index.html

-Justin