Mr A
Mr A

Reputation: 1385

Ruby on Rails: http://localhost:3000 not working

Machines:

Notes

Pre-requisite

Problem

What Is Needed

Quirks

Upvotes: 0

Views: 2319

Answers (2)

dy1901
dy1901

Reputation: 61

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.

Upvotes: 3

dimakura
dimakura

Reputation: 7655

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

Upvotes: 1

Related Questions