首页 > 解决方案 > 无法调用应用。对“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 代码中了解到随机端口。

标签: ruby-on-rails

解决方案


好的,我修好了。就我而言,当用户未登录时,root url 重定向到登录页面。所以这导致 gem 错误请求,目前似乎无法正确处理 302。所以我修好了。。

PATH_TO_HIT="/login"  bundle exec derailed exec perf:mem_over_time

是的,我还必须删除它,USE_SERVER=puma因为它也会导致错误。


推荐阅读