问题描述
我被难住了.我在 docker 中运行了 Rails 5 的原版安装,但我不断收到此错误:
I'm stumped. I have a vanilla install of Rails 5 running within docker yet I'm constantly getting this error:
请求运行时间超过 5000 毫秒
到目前为止,我所做的只是使用 docker-compose run website rails g controller pages
生成一个新控制器.
All I've done so far was generate a new controller with docker-compose run website rails g controller pages
.
到目前为止,如果我从 layouts/application.html.erb
中删除(非常重要的)行,我可以加载页面:
So far, if I remove (very important) lines from layouts/application.html.erb
, I can get the page to load:
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
但我放弃了所有默认样式(引导程序)以及我希望在以后加载的任何潜在 javascript 文件,我认为这不是解决方法.
But I loose all my default styling (bootstrap) and any potential javascript files I wish to load later in life, which I do not consider to be a fix.
还有其他人遇到过这个问题并知道如何解决吗?
Anyone else run into this problem and know how to fix it?
推荐答案
@JimmyBaker 在评论中回答
@JimmyBaker answered in the comments
尝试将 config.assets.debug 设置为 false
内部 config/development.rb
config.assets.debug = false
将此设置为 false 将导致所有 CSS &JS 被捆绑到 application.css
或 application.js
更多关于资产的信息.调试
Having this set to false will cause all CSS & JS to be bundled into application.css
or application.js
More on assets.debug
这篇关于Rails 5 请求运行时间超过 5000 毫秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!