【问题标题】:Rails Puma: --no-dev-caching does not workRails Puma:--no-dev-caching 不起作用
【发布时间】:2020-05-24 02:56:04
【问题描述】:

每当我更改包含的.scss 文件时,即使我重新启动服务器,我也看不到更改。我发现如果我手动删除tmp/cache/*然后重新启动服务器,我可以看到一次更改。未显示进一步的更改(并且缓存又回来了)。我试过rails server --no-dev-caching,但没有帮助。我有

config.assets.digest = false
config.assets.debug = false
config.assets.quiet = false
config.assets.raise_runtime_errors = true
config.action_controller.perform_caching = false
config.cache_store = :null_store

在开发中重新加载页面时如何查看 SCSS 文件的更改?我使用 curl http://localhost:3000/assets/application.css | less 进行测试并搜索我更改并保存的类。

=> Booting Puma
=> Rails 5.0.7.2 application starting in development on http://localhost:3000
* Version 3.12.2 (ruby 2.4.3-p205), codename: Llamas in Pajamas
* Environment: development

文档:https://guides.rubyonrails.org/v5.0/configuring.html#configuring-assets


我注释掉了 Puma,使用了带有 rails server --no-dev-caching 的 WebBrick,设置了 config.assets.debug = true,加载了 $ curl http://localhost:3000/assets/theme/theme.self.css | less,但更改仍然不存在。

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-5 windows-8.1


    【解决方案1】:

    我在这里找到了答案! https://stackoverflow.com/a/59895954/148844

    我不得不更改@import "theme-overrides.scss"; => @import "theme-overrides";,重命名theme-overrides.scss => _theme-overrides.scss,更改@import "theme_components/helpers.scss"; => @import "theme_components/helpers";,重命名helpers.scss => _helpers.scss,一切正常!

    现在我必须重命名 100 个不同的文件!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-11
      • 2021-12-11
      • 2016-01-16
      • 2020-04-09
      • 2014-02-08
      • 2018-05-05
      • 1970-01-01
      • 2014-05-31
      相关资源
      最近更新 更多