Access Rails Development Server From A Different Computer

淺唱寂寞╮ 提交于 2019-12-03 02:44:24

问题


I'm using webrick to develop my rails app on Mac OS X Lion. I'm trying to access the site from another computer (for testing). The internal IP of my computer is 10.1.10.100.

Accessing 10.1.10.100 displays the page served by the apache server running on my computer.

Accessing 10.1.10.100:3000 times out, both from my computer and from another computer on the same network. I can ping 10.1.10.100. From my computer, loaclhost:3000 displays the app.

Is there are firewall I need to open up on Mac OS X or some other setting that needs to be applied?

Thanks


回答1:


While starting the webrick server specify the IP on which your rails application will run (10.1.10.100 in your case) using -b option, it binds Rails to the specified IP.

rails server -b 10.1.10.100 -p 3000


来源:https://stackoverflow.com/questions/10078454/access-rails-development-server-from-a-different-computer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!