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

issue with jbuilder and caching #2471

Closed
seboslaw opened this issue Apr 17, 2020 · 1 comment
Closed

issue with jbuilder and caching #2471

seboslaw opened this issue Apr 17, 2020 · 1 comment

Comments

@seboslaw
Copy link

Hey guys,

I'm having an issue when using carrierwave in combination with jbuilder and caching (Rails default file caching).

I'm using jbuilder.cache! to cache the JSON I want to render out via an API.

json.cache! [@event] do
...

When I still ran Rails 5.2.3 everything worked fine, but since I've upgraded to Rails 5.2.4.2 I get the following error in production when restarting the server at the end of a deployment and loading the JSON the first time:

An ActionView::Template::Error occurred in events#show_v2:

 uninitialized constant MediaItemUploader::Uploader47081233157840
Did you mean?  MediaItemUploader::Uploader47362494653720
 app/views/events/events/show_v2.json.jbuilder:2:in _app_views_events_events_show_v__json_jbuilder___1680057252446656557_47362491425440

I've dug into the issue and it seems that the object I'm caching has an associated uploader (MediaItemUploader) which makes problems when being serialised (and then de-serialized) to a file during caching. Is that the issue here? Is there a way to solve this except wiping the cache on each deployment?
Is there any reason this worked with 5.2.3?

Cheers,

Sebastian

@nachiket87
Copy link
Contributor

@seboslaw did you find a fix for this?

@mshibuya mshibuya added this to the Release v3.0.0 milestone Jan 15, 2023
mshibuya added a commit that referenced this issue Jan 15, 2023
mshibuya added a commit that referenced this issue Jan 15, 2023
mshibuya added a commit that referenced this issue Jan 15, 2023
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

3 participants