Running Ruby Sinatra on Cloud 9

This guy is great! Saved me tons of time putzing around with CLI to get my ruby install going ….turns out I did nothing wrong – just you have to use the place holders instead of feeding a literal IP or port …

Another link

Simon Curd | Technologist

I spent a good half hour trying to run up a Ruby web server using Sinatra on Cloud 9. The instructions on the Output screen say:

Your code is running at http://<project-name>.<username>'.
Important: use 'ruby app.rb -p $PORT -b $IP' to run your server apps!

In fact, these are the instructions for a Rails application, and the -b switch is invalid for Sinatra applications, which I discovered when using the Terminal window (which can be opened using the button in the bottom right of the screen).

Error: you may be using the wrong PORT & HOST for your server app
For rails, use: 'rails s -p $PORT -b $IP'
For Sinatra, use: ruby app.rb -p $PORT -o $IP'

As stated, the correct command to run a Sinatra application on Cloud 9 is:

ruby wstest.rb -p $PORT -o $IP

My mistake was assuming that I needed to replace $PORT and $IP with my own values – you don’t – Cloud 9 routes calls from http://<project-name&gt;.<username> to your application.

Aside from this hiccup, running a Sinatra-based Ruby web server on Cloud…

View original post 3 more words


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s