Search code examples
ruby-on-railsnetworkingvmware-fusion

Can’t access rails app on Mac host from VMware Fusion Guest


I’m probably doing something stupid here, but....

I can’t access a rails app running on my Mac from a Windows 10 VM. I have set the network adapter to "Share with My Mac". I can access a PHP site running on my mac via http://[my-machine-name].local or http://[my-ip-address]. But if I specify port 3000 to view my rails app I get an error message (to the effect that [my-ip-address] refused to connect) even though the app is running. I don’t know if this is an issue at the Mac end (though my firewall is off for testing), the windows end, or to do with my VMWare network adapter setting. Any assistance gratefully received

Peter


Solution

  • Just use the -b flag while running your rails app like rails server -b 0.0.0.0:3000 so it gets bound to the whole network interfaces and it can be accessed from outside