documentcloud / jammit

Industrial Strength Asset Packaging for Rails
http://documentcloud.github.com/jammit/
MIT License
1.16k stars 197 forks source link

NameError (undefined local variable or method `page_cache_directory' for #<Jammit::Controller:0x007f1daee33488>): #271

Open nynhex opened 8 years ago

nynhex commented 8 years ago

We were using Jammit on a Rails 3 application which we just upgraded to 4.2.6. After deploying to production we started getting this error and our page views/css do not display properly

NameError (undefined local variable or method `page_cache_directory' for #<Jammit::Controller:0x007f1daee33488>):

We are on Rails 4.2.6, Ruby 2.3.0, and Jammit 0.7.0

Can anyone provide some insight on if there are compatibility issues with Jammit and Rails 4.2.6? If so can you point me in the direction of where this needs to be fixed so I can PR. Or should we scrap the gem and migrate to the asset pipeline?

knowtheory commented 8 years ago

Hey! We're still using it. Not super satisfied with it, however if you pull off of Master things should still work: https://github.com/documentcloud/documentcloud/blob/master/Gemfile#L34

nynhex commented 8 years ago

@knowtheory Thanks, I'm bundling in master. Bundles fine, but when I go to deploy the app into production capistrano gives me this

fatal: Could not parse object 'cc9c5a87624bc5f0b82128a1daa5599f03eccaa0'.
nynhex commented 8 years ago

@knowtheory Figured this out, had to delete the shared/cached-copy directory. But I'm still getting the error:

NameError (undefined local variable or method `page_cache_directory' for #<Jammit::Controller:0x000000064fc4e0>):

And none of our pages are showing up right. Is it time to move to asset pipeline and if so what's the best strategy of doing so coming from rails 3 to 4.2.6 and converting everything?

anthonycrumley commented 3 years ago

The NameError results from the fact that "Static page caching for Action Pack (removed from core in Rails 4.0)." It was moved to a separate gem called actionpack-page_caching. Once this gem is added to the Gemfile then the error will be resolved.