0

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...

Eren Golge
  • 802
  • 2
  • 12
  • 27
  • What kind of router? I ask because DDWRT had a deceiving interface at one point – Kyle Macey Apr 19 '12 at 01:59
  • For anyone running across this qustion, try [this](http://stackoverflow.com/questions/7325663/access-webrick-rails-from-another-computer-on-local-network/28948293#28948293). – OneHoopyFrood Mar 09 '15 at 17:38

1 Answers1

7

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.

Ben Taitelbaum
  • 7,343
  • 3
  • 25
  • 45
  • Just to be clear, you're using an ip address in place of a.b.c.d, correct? Can you use `lsof | 3000` to see what address the rails process is binding on? Does it help to be explicit by launching rails with the -b option? – Ben Taitelbaum Apr 21 '12 at 03:51