To do that, I added a line to the
development config (
config.hosts << 'hostname.local'
Update: Apparently adding the line
config.hosts.clear works as well. Details about this are explained in the Rails Guides.
I started using Foreman to achieve this, and installed it using:
gem install foreman
Note that, according to a Wiki Page on Github, it’s not recommended to put
foreman into the
Then I created a
Foreman uses to start the web server (which currently is the only process I need it to start):
web: bundle exec rails s -b 0.0.0.0 -p 3000
-b 0.0.0.0 binds the process to that IP address and
-p 3000 instructs it to use port 3000.
With that set up
foreman start can be used to start a Rails server in development which is available in the local network.
This way I can check the layout and functionality on a mobile phone or one of my iPads.