Rog*_*ger 2 ruby-on-rails ruby-on-rails-5
我正在为此而头疼。我找不到清除 ROR5 应用程序的生产缓存的方法,然后重新启动nginx。如果我在app/views/layouts/application.html 中更改了某些内容(例如),那么在我重新加载/重新启动服务器之前,这些更改不会反映出来。
我编辑了config/environments/production.rb并更改了:
config.action_controller.perform_caching = false
Run Code Online (Sandbox Code Playgroud)
也试图设置
config.cache_store = false
Run Code Online (Sandbox Code Playgroud)
我想,ROR 中有太多缓存元素,我迷路了。
我想知道以下内容:
在站点注释上:我在 Raspberry Pi 上运行该应用程序,我需要修复一些问题,然后我通过 ftp 将更改直接推送到框。我知道这不是修复它的最佳方法,但重新启动 nginx 需要一些时间。我知道我可以将盒子切换到开发模式,但我现在不想这样做。
谢谢!
实际上有几个 rake 任务需要在每个部署上运行以确保干净利落:
rails tmp:clear # clears all cache and sockets files.
rails db:schema:cache:clear # Clears a db/schema_cache.dump
rails assets:precompile # Compile all the assets
rails db:migrate
# ... + a few things I already forgot.
rails restart
Run Code Online (Sandbox Code Playgroud)
手动执行此操作将成为 PITA。而是使用Capistrano并设置自动部署过程。有了Capistrano::Rails它应该几乎即插即用。
| 归档时间: |
|
| 查看次数: |
4145 次 |
| 最近记录: |