Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoMethodError: undefined method `read' for class SolidCache::Entry #237

Open
amkisko opened this issue Nov 6, 2024 · 3 comments
Open

NoMethodError: undefined method `read' for class SolidCache::Entry #237

amkisko opened this issue Nov 6, 2024 · 3 comments

Comments

@amkisko
Copy link

amkisko commented Nov 6, 2024

Hey!

After full setup, getting this error:

$ bin/rails c

> Rails.cache.exist?("test")
NoMethodError: undefined method `read' for class SolidCache::Entry
from /Users/me/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/activerecord-7.2.1.2/lib/active_record/dynamic_matchers.rb:22:in `method_missing'

Can't figure out what's missing, anybody got the same?

Setup:

  • cache.yml
default: &default
  store_options:
    # Cap age of oldest cache entry to fulfill retention policies
    # max_age: <%= 60.days.to_i %>
    max_size: <%= 256.megabytes %>
    namespace: <%= Rails.env %>

development:
  <<: *default

test:
  <<: *default

production:
  <<: *default
  • config/environments/development.rb
config.cache_store = :solid_cache_store
  • Gemfile.lock
    rails (7.2.1.2)
      actioncable (= 7.2.1.2)
      actionmailbox (= 7.2.1.2)
      actionmailer (= 7.2.1.2)
      actionpack (= 7.2.1.2)
      actiontext (= 7.2.1.2)
      actionview (= 7.2.1.2)
      activejob (= 7.2.1.2)
      activemodel (= 7.2.1.2)
      activerecord (= 7.2.1.2)
      activestorage (= 7.2.1.2)
      activesupport (= 7.2.1.2)
      bundler (>= 1.15.0)
      railties (= 7.2.1.2)
    solid_cache (1.0.6)
      activejob (>= 7.2)
      activerecord (>= 7.2)
      railties (>= 7.2)

RUBY VERSION
   ruby 3.3.4p94

BUNDLED WITH
   2.5.20
@djmb
Copy link
Collaborator

djmb commented Dec 23, 2024

Hi @amkisko - what does your config/database.yml look like?

@djmb
Copy link
Collaborator

djmb commented Dec 24, 2024

Also could you add this in an initializer and see if anything useful is logged:

SolidCache::Store.logger = Rails.logger

@amkisko
Copy link
Author

amkisko commented Dec 27, 2024

After full move to Rails 8 and using latest solid_cache version, I can't replicate the issue anymore, it all works without issues at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants