While using Cloud9 IDE, you have access to the Ruby runtime. Accessing the command is no different than the way you’d use Ruby on your computer; just open the command line and type
ruby. Currently, the default version is 1.9.3.
To run a Ruby program that you’ve created, you can either:
- Open the command line and type
ruby, followed by the name of your program; for example
- Create a new run scenario, so that you can do things like pass in command line arguments
As a quick demonstration, open a new file, and paste this Ruby code into it:
#!/usr/bin/ruby puts 'Hello world'
When you hit the run button in the menu bar, the console will print out
Cloud9 has Ruby Version Manager preinstalled so you can use that to change the version of Ruby to whatever you’d like. For more info on how to do that, see How to Upgrade Ruby.