Alex S
Alex S

Reputation: 11

Hit dev web server from outside IP in Rails 5.1?

I'm trying to run Rails 5.1 in a vm managed by Vagrant, but I can't hit the web site with a browser running on my host (MacOS Sierra).

I've verified that port forwarding in Vagrant and VirtualBox is working, and that the Guest OS (Fedora Server) is not blocking the traffic with a firewall. I can access a Rails 5.0.2 site on the same vm without problems.

Is there anything that's changed in 5.1 that would prevent me from connecting from the host OS?

Upvotes: 0

Views: 38

Answers (1)

Alex S
Alex S

Reputation: 11

My problem was caused by a small bug in Rails 5.1.0. If you start the dev web server with:

rails s -b 0.0.0.0

The server will bind to the wrong port (9292) instead of the normal one (3000).

Until the bug is fixed, it's possible to work around it by specifying the port on the command line explicitly:

rails s -b 0.0.0.0 -p 3000

Upvotes: 1

Related Questions