Cloud 9 IDE - Web Server running but not displaying in browser

rails

#1

I have a rails project on Cloud9
When I start run server using command rails s -b $IP -p $PORT
I get the following
rails s -p $PORT -b $IP
=> Booting Thin
=> Rails 4.1.6 application starting in development on http://some_ip:8080
=> Run rails server -h for more startup options
=> Ctrl-C to shutdown server
Thin web server (v1.7.2 codename Bachmanity)
Maximum connections set to 1024
Listening on some_ip:8080, CTRL+C to stop

Everything looks fine. But when I got to browser
and type http://some_ip:8080 NOTHING IS HAPPENING.

but at the same time, I try using curl http://some_ip:8080 I receive the response, so it is working properly.

Do you know what is the problem?


#2

Is some_ip 0.0.0.0? If so, you wouldn’t be able to hit that from the web browser; you’ll want to use your workspace’s preview URL instead, which serves anything running on 0.0.0.0:8080 internally. Hitting some_ip from the terminal with curl will return the page since it’s running internally, so the native URL will work.


#3

Thank you for your answer but my question is still open.
I have tried to run server on ide.c9.io using port 8080 and IP 0.0.0.0
rails s -b 0.0.0.0 -p 8080
=> Booting Thin
=> Rails 4.1.6 application starting in development on http://0.0.0.0:8080
=> Run rails server -h for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (–binding option)
=> Ctrl-C to shutdown server
Thin web server (v1.7.2 codename Bachmanity)
Maximum connections set to 1024
Listening on 0.0.0.0:8080, CTRL+C to stop

but still, nothing happened in a browser when I go to preview URL. How can I get workspace’s preview URL? Can I simply use IP address of workspace and port 8080? If yes, I still have the same problem