Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ddeveloperr
Last active December 14, 2020 21:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddeveloperr/4ef0faa9ef02dc469a69 to your computer and use it in GitHub Desktop.
Save ddeveloperr/4ef0faa9ef02dc469a69 to your computer and use it in GitHub Desktop.
Start Ruby on Rails and Ruby Sinatra app on Cloud9!

Run Ruby on Rails/Sinatra app on Cloud9 IDE

##Problem:

I spent hours trying to run up a Ruby web server using Sinatra on Cloud 9. The cloud9 IDE 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!!!

Error: you may be using the wrong PORT & HOST for your server app

##Solution:

###For rails, You should type:

'rails server -p $PORT -b $IP'
=> Your rails app will UP and Running!

###For make your Sinatra applications UP and Running type in the console:

ruby app.rb -p $PORT -o $IP'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment