Sachin Prasad
Sachin Prasad

Reputation: 5411

removing cache from command line in ruby on rails

I want to remove cache from my code. My code is in 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 . It is giving me this error 'Rails.cache.clear' command not found.

Upvotes: 1

Views: 2355

Answers (2)

Marcelo Alves
Marcelo Alves

Reputation: 323

Rails.cache.clear needs to be ran from the Rails console.

Upvotes: 9

Cninroh
Cninroh

Reputation: 1796

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 :

 # 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.

Upvotes: 1

Related Questions