我正在构建一个单页应用程序。我的前端(用 React 编写)对后端进行了两次调用,并且 Rails 服务器挂起。我的意思是,执行没有达到所涉及的操作,并且什么也没有发生。建议?我在这上面花了很多时间,我不知道该怎么想了。这是控制台的输出。
我也尝试过使用 webrick,所以我认为问题不是来自 Puma。
=> Booting Puma
=> Rails 5.1.3 application starting in development on http://localhost:3002
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.10.0 (ruby 2.4.1-p111), codename: Russell's Teapot
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3002
Use Ctrl-C to stop
Started GET "/api/working-groups" for ::1 at 2017-09-05 11:29:52 +0200
Started GET "/api/invoicing-sessions" for ::1 at 2017-09-05 11:29:52 +0200
最佳答案
对于发现此问题的任何人:这似乎仍然是 open Rails issue #33209 .
tl;dr 解决方法是设置:
# config/environments/development.rb
config.eager_load = true
关于ruby-on-rails - Rails 服务器在前端发出两个请求后(有时)挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46051867/