[英]removing cache from command line in ruby on rails
I want to remove cache from my code.我想从我的代码中删除缓存。 My code is in Ruby on rails.我的代码在 Ruby on rails 中。 The issue is that i have updated my design but it is displaying the older one.问题是我已经更新了我的设计,但它显示的是旧的。 I tried this Rails.cache.clear
command but its not working .我试过这个Rails.cache.clear
命令,但它不工作。 It is giving me this error 'Rails.cache.clear' command not found.
它给了我这个错误'Rails.cache.clear' command not found.
Rails.cache.clear
需要从 Rails 控制台运行。
You need to go to ./config/environments/production.rb or development.rb depending where do you launch your code, and change settings to reflect this :您需要转到 ./config/environments/production.rb 或 development.rb 取决于您在哪里启动代码,并更改设置以反映这一点:
# Code is not reloaded between requests
config.cache_classes = false
and if necessary, comment out your cache store line :如有必要,注释掉您的缓存存储行:
# Use a different cache store in production
config.cache_store = :dalli_store
Ideally the first snippet should be enaught.理想情况下,第一个片段应该足够了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.