0

我尝试在 Ubuntu 的计算机上托管我的 ruby​​ on rails 应用程序,但我无法获得它。我尝试从我的路由器设置进行端口转发。我想我成功地转发了源端口 80 - 8080 和目标端口 3000 的端口。然后我在生产模式下启动 webrick。但是,我无法通过输入外部 IP 从 Internet 打开我的应用程序。如何正确设置我的计算机?你有什么建议吗?

谢谢...

4

1 回答 1

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.

于 2012-04-19T02:07:50.520 回答