ruby-on-rails - 无法调用应用。对“curl 'http://localhost:3564/' -s --fail 2>&1”的错误请求 derailed_benchmarks gem
问题描述
我收到如下粘贴的错误消息:
% USE_SERVER=puma bundle exec derailed exec perf:mem_over_time
Booting: production
docking_dev already exists
Endpoint: "/"
Port: 3857
Server: "puma"
[4990] Puma starting in cluster mode...
[4990] * Version 3.7.0 (ruby 2.3.3-p222), codename: Snowy Sagebrush
[4990] * Min threads: 5, max threads: 5
[4990] * Environment: production
[4990] * Process workers: 2
[4990] * Preloading application
[4990] * Listening on tcp://0.0.0.0:3000
[4990] Use Ctrl-C to stop
[4990] - Worker 0 (pid: 5013) booted, phase: 0
[4990] - Worker 1 (pid: 5014) booted, phase: 0
PID: 4990
149.67578125
Couldn't call app.
Bad request to "curl 'http://localhost:3857/' -s --fail 2>&1"
***RESPONSE***:
""
[5014] ! Detected parent died, dying
[5013] ! Detected parent died, dying
我检查RAILS_ENV=production rails server
并按RAILS_ENV=production rails console
预期工作。我还需要检查什么才能使其正常工作。这是因为我的http://localhost:3000/
网址启用了身份验证。我检查了我force_ssl
转向false
. 我检查了这篇文章,它建议没有帮助。
我也不知道为什么每次运行它时它都会选择一些随机端口,就像在这个粘贴的一样3857
。但是我的应用程序在本地使用 3000 端口运行。我需要做些什么才能使用相同的端口 3000?
PS 为什么我从gem 代码中了解到随机端口。
解决方案
好的,我修好了。就我而言,当用户未登录时,root url 重定向到登录页面。所以这导致 gem 错误请求,目前似乎无法正确处理 302。所以我修好了。。
PATH_TO_HIT="/login" bundle exec derailed exec perf:mem_over_time
是的,我还必须删除它,USE_SERVER=puma
因为它也会导致错误。
推荐阅读
- elasticsearch - 电子邮件不工作的弹性条款查询
- c++ - 如何在循环中使用scanf,将值存储到一个变量中,然后再打印?
- r - 将变量名称及其向量值粘贴到多个变量中
- android - 删除后我可以在firebase中通过电话号码重新创建用户身份验证吗?
- python - Python Matplotlib 散点图压缩 Y 轴
- google-sheets - 如何查看两个单元格之间滚动平均值的 +/- 变化
- mysql - 当列匹配特定值时插入或替换
- r - 在 ggplot 中,如何将数据绘制为折线图?
- r - 将相应的颜色值分配给要在 R 中的 ggplot(使用 geom_col)中绘制的最终模型变量
- python - 在 systemd 服务中启动时 Python 子进程库失败