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 …
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>.c9.io'. 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>.<username>.c9.io to your application.
Aside from this hiccup, running a Sinatra-based Ruby web server on Cloud…
View original post 3 more words