After making sure your server side firewall is open to the incoming connection on high ports (this is normally true and the default port is 3000, so you probably don't have to do anything) you must also start the server like this:
rails server -b 0.0.0.0
which binds it to the universal address. It binds to localhost
by default.
Using this method you don't have to bind to port 80, but you can like this:
rails server -b 0.0.0.0 -p 80
(If you're using rvm then you may need to use rvmsudo
)
To make this change more permanent edit your config/boot.rb
and add this:
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 should only have to use rails s
Source: https://mcmap.net/q/195841/-how-to-change-the-default-binding-ip-of-rails-4-2-development-server
192.168.100.50
, on that machine, run:rails s -b 192.168.100.50 -p 80
– Dactylology