Once your server-side firewall is open for incoming connections on high ports (usually true, but the default is 3000, so you probably don't need anything), you should also start the server
rails server -b 0.0.0.0
which associates it with a universal address. It binds to localhost by default.
Using this method, you do not need to communicate with port 80, but you may like the following:
rails server -b 0.0.0.0 -p 80
(If you are using rvm, you may need to use rvmsudo )
To make this change more permanent, change your config/boot.rb and add the following:
require 'rails/commands/server' module Rails class Server def default_options super.merge(Host: '0.0.0.0', Port: 3000) end end end
Then you only need to use rails s
Source: stack overflow
OneHoopyFrood Mar 09 '15 at 17:35 2015-03-09 17:35
source share