Last Updated: February 25, 2016
· mattl

Running Sinatra Apps in Cloud9 IDE

Cloud9 IDE is pretty awesome for what it is. It took a long time for them to support Sinatra and then it took me longer to work out how to run my app.

Inside your Sinatra workspace, in the console at the bottom, type:

echo $IP

and then:

echo $PORT

Then under the RUN & DEBUG menu click on the plus to create a new runtime configuration. Give it a Name, enter the path to your Sinatra base rb file, change the *Runtime** select box to Ruby and then in the Cmd Line Args box enter the details you got earlier:

-p [port] -o [port]

Obviously replacing the [] with your details that were echoed previously.

Once you have entered all this then either double click your new entry in the RUN & DEBUG menu or use the Run button at the top of the window, clicking the drop down box next to it and selecting your new configuration.

Hope this helps someone.

Say Thanks