相关疑难解决方法(0)

如何忽略 Zeitwerk for Rails 6 中的文件夹?

简单的问题,但不知何故,答案让我望而却步。

在使用 Zeitwerk 迁移到 Rails 6 时,我得到:

Please, check the "Autoloading and Reloading Constants" guide for solutions.
 (called from <top (required)> at APP_ROOT/config/environment.rb:7)
rails aborted!
Zeitwerk::NameError: wrong constant name Enforce-calls-to-come-from-aws inferred by Module from directory

  APP_ROOT/app/junkyard/enforce-calls-to-come-from-aws

Possible ways to address this:

  * Tell Zeitwerk to ignore this particular directory.
  * Tell Zeitwerk to ignore one of its parent directories.
  * Rename the directory to comply with the naming conventions.
Run Code Online (Sandbox Code Playgroud)

这看起来很棒:这是一个垃圾文件夹,永远不应加载,因此忽略它是完全有道理的。

https://github.com/fxn/zeitwerk 上的 Zeitwerk 文档说

tests = "#{__dir__}/**/*_test.rb"
loader.ignore(tests)
loader.setup …
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails ruby-on-rails-6

11
推荐指数
2
解决办法
3733
查看次数

工人 puma 日志的提前终止是什么意思,为什么会发生这种情况?

对于我的 Elastic Beanstalk 实例,504每当我访问它时都会收到状态代码响应。当我跟踪日志时,我会在 puma 应用服务器上看到以下日志:

==> /var/log/puma/puma.log <==
[27240] Early termination of worker
[27245] Early termination of worker
[27249] Early termination of worker
[27253] Early termination of worker
[27257] Early termination of worker
[27261] Early termination of worker
[27265] Early termination of worker
[27269] Early termination of worker
[27273] Early termination of worker
[27277] Early termination of worker
Run Code Online (Sandbox Code Playgroud)

是什么Early termination of worker意思,为什么会发生?此外,日志是否可以指出我在远程环境中面临的超时错误的原因?rails 应用程序和 puma 在我的本地机器上完美运行(Mac OS Catalina 10.15)。但是,在如上所述的远程 Elastic beanstalk 环境中,我收到超时 504 错误,并且我在日志中看到的唯一内容是上面的 puma 日志。 …

ruby-on-rails puma amazon-elastic-beanstalk

6
推荐指数
1
解决办法
2449
查看次数