Eren Golge
Eren Golge

Reputation: 790

Setting up the Webrick to serve to internet my rails app

I try to host my ruby on rails app in my computer in Ubuntu but I cannot get it. I try to port forward from my router settings. I think I successfully forward the ports a source ports 80 - 8080 and destination port 3000. Then I start webrick in production mode. However, I could not open my app from internet by typing my external IP. How can I set my computer in proper way? Do you have any suggestions?

Thanks...

Upvotes: 0

Views: 3529

Answers (1)

Ben Taitelbaum
Ben Taitelbaum

Reputation: 7403

Try the following to help debug the issue:

  1. From the same machine (you can use curl in place of wget if you'd like, as it's more powerful), make sure rails is running

    $ wget http://localhost:3000

  2. From the same machine, make sure the server is bound to an external ip address

    $ ifconfig (lists the ip address a.b.c.d)

    $ wget http://a.b.c.d:3000

  3. From another machine on the same network, make sure you request the web page

    $ wget http://a.b.c.d:3000

If the first step fails, rails might not be running. If the second step fails, then you might have an issue with how networking is setup, but you can try rails server -b a.b.c.d to see if that fixes it. If the last step fails, then you have an issue with your local network. Finally, if they all succeed, then the issue is either with your ISP or with your router.

Upvotes: 7

Related Questions