I’ve been using vagrant to set up ruby on rails project environment, which is best practice in my opinion. One can perfectly and easily have a clean envrionment, in my case, ubuntu64 to put the whole rails server in while coding in familiar platform using favourite editor.
Usually, I would type in shell the following commands
|
|
the server is up and I can open Chrome on MacOS and type in [project-name].dev:3000 to have a look at the website under development. [project-name].dev is an alias to the IP address of the virtual machine. It’s all beautiful.
However, when I set up a new project today as usual and open up a browser, the server did not respond.
At first I thought it was the rails’s problem. So I tried to connect to the server locally with telnet.
|
|
which performed perfectly.
It turns out that when I http request [project-name].dev:3000, the server received nothing at all. Though I still don’t get what’s different from the previous ones, I forced the server listen to the ip address on start up and the problem is solved.
|
|
The server listens to http://localhost:3000 by default, then the problem is how the previous ones worked… LOL