~/Code: nr test
Opens:
GNU nano 2.0.6 File: test
#!/usr/bin/env ruby
<cursor here>
Once you're done typing your ruby code, you can use ^O + ^X to write and quit the file.
Then you're ready to execute the script already:
~/Code: ./test