Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8816929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:44:00+00:00 2026-06-14T04:44:00+00:00

We cache id/path mapping using Rails.cache in a Rails 3.2 app. On some machines

  • 0

We cache id/path mapping using Rails.cache in a Rails 3.2 app. On some machines it works OK, but on the others values are wrong. The cause is hard to track so I have some questions about the Rails.cache itself. Is it purged between tests? Is it possible that values cached in development mode is used in test mode? If it’s not purged, how could I do it before running specs?

My cache store is configuration is:

#in: config/environments/development.rb
config.cache_store = :memory_store, {:size => 64.megabytes}

#in: config/environments/production.rb
# config.cache_store = :mem_cache_store
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:44:01+00:00Added an answer on June 14, 2026 at 4:44 am

    Add:

    before(:all) do
      Rails.cache.clear
    end
    

    to have the cache cleared before each spec file is run.

    Add:

    before(:each) do
      Rails.cache.clear
    end
    

    to have the cache cleared before each spec.

    You can put this inside spec/spec_helper.rb within the RSpec.configure block to have it applied globally (recommended over scattering it per spec file or case).

    RSpec by default does not clear that cache automatically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using file cache in symfony to store my data for some time
I saw some hash like the following in some .rb configuration file cache( :path
The path to libidl.so.7.1 is in ld.so.conf, and the library is in the cache
What's the path on disk used by System.Net.WebClient (i.e. WebRequest ) etc. to cache
i am using output cache attribute to cache my page , [OutputCache(Duration = 50000)]
in iphone i have requirement of store image in cache . but how i
initial cache object code as follow: pageCache = Cache() cacheDir = os.path.join(path.dirname(path.dirname(__file__)),'pageCache') pageCache.init_app(flaskApp,config={'CACHE_TYPE': 'filesystem','CACHE_THRESHOLD':1>>10>>10,'CACHE_DIR':
I designing an programming a website using Symfony2. I completed some parts and checked
I save some run-time generated files inside the .app bundle of my iOS app.
I'm having some problem expiring an action cache in my application. Here is my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.