Writing a Ruby App



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 ruby hello_world.rb
  • 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:


puts 'Hello world'

When you hit the run button in the menu bar, the console will print out Hello world.

Upgrading Ruby

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.

Tutorials - Table of Contents
The server keeps crashing giving fatal SignalException
Images and links broken in cloud9 docs pages

RVM says that it is not the latest version, but won’t let me
rvm get latest

Will c9 eventually upgrade rvm on its own?