Any old text editor can be used to type Ruby code.
What you seem to be after is a way to run Ruby code. Ruby code is run by a Ruby interpreter. Here is a link to a package that provides an execution environment for Ruby:
You didn’t specify your end goal (like, say, developing a Rails app) so I have to assume that you just want something to execute Ruby against.