简体   繁体   中英

Can't connect Rails-project to localhost when computer is connected to internet

I just recently begun having the problem that I'm only able to visit localhost:3000 when wifi is turned off and computer is disconnected from the internet.

As soon as I turn on wifi and connect the computer to an internet connection, chrome just says "connecting" in bottom left corner of browser window. There are no errors present.

I've tried on three completely different connections. Home wifi, office and hotspotting via phone.

I have also tried on several different Rails-projects, both rails 5 and below. So it doesn't seem to be project-related.

I have also tried booting the server using my computers IP address as well as 0.0.0.0, and as well as on a different port than :3000. I've also tried in different browsers.

If it is to any use:

=> Booting Puma
=> Rails 5.0.1 application starting in development on http://xxx.xx.xx.x:3000
=> Run `rails server -h` for more startup options
[Simple Form] Simple Form is not configured in the application and will use the default values. Use `rails generate simple_form:install` to generate the Simple Form configuration.
Puma starting in single mode...
* Version 3.7.0 (ruby 2.2.4-p230), codename: Snowy Sagebrush
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop

Observation:

This error does not affect rendering partials asynchronously inside the view. That is as smooth and quick as it use to be. This only happens when trying to go from projects/:id/edit to projects/new for instance.

If, as you say, there are no errors and AJAX calls are working smoothly, I'd say that you are using an asset that is fetched from the internet but is not available right now. While the internet is working, the application will keep waiting for a response from the remote server.

When you disconnect from the internet and load the page, see if you get any errors in the browser console about failing to fetch something and try removing it from your application. Let me know if this turns out to be your issue.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM