Machines:
Notes
Pre-requisite
bundle exec rails s -p 3000
Problem
http://localhost:3000
NOT working https://192.168.1.37:3000
working What Is Needed
http://locahost:3000
Quirks
why do you insist to visit the site via localhost:3000? as you are running the app under vm, if you want to access the webpage from another pc/mac via ip, you have to forward the local port to the vm port via nat, or let the vm to own a ip from your local network.
As you can access the webpage via https://192.168.1.37:3000 , rails is running, there's nothing to do with rails configurations.
Rails 4 binds on localhost
by default, so you will need to bind to 0.0.0.0
, if you want the page to be accessible from another machine.
Start your rails server like this:
bundle exec rails s -p 3000 -b 0.0.0.0
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.