Closed hankish closed 8 years ago
Update: I can replicate the issue in development now (I had forgotten to set the environment to production). So to replicate the issue you just run:
RAILS_ENV=production bundle exec rake assets:precompile
Hm.. looks like this is a common issue for a number of gems https://github.com/rails/sprockets-rails/issues/237. Since config.assets.compile
is disabled for production environment there's no Rails.application.assets
to prevent assets from compiling.
However I've added a workaround by using Sprockets::CachedEnvironment
which is now in v 1.2.4.1
cc @hankish
@alchapone: Thanks for the quick update! That definitely resolved my issue. Is it ok if I close this github issue then?
Just to drop this in here, the other big problem keeping this from working reliably in production is alchapone/polymer-elements-rails#11 over in the polymer-elements-rails gem. Could you throw some love over there when you have a minute? (I'm having to reference the github repo in my production gemfile which feels yucky.)
I'm having trouble replicating this on my development machine but when I'm deploying to heroku I get a
NoMethodError: undefined method 'paths' for nil:NilClass
error when it hits/lib/polymer-rails/processors/component.rb:50:in 'absolute_asset_path'
. This is keeping me from deploying to production and I can't figure it out.Here's the relevant part of
component.rb
(line 50 is::Rails.application.assets.paths.each do |path|
):It makes sense that I'm getting it since sprockets 3 supposedly returns
nil
whenconfig.assets.compile = false
(as it is in production), but I'm confused as to why I'm not getting this issue when I runbundle exec rake assets:precompile
on my local development machine.Any ideas as to a solution?
My Gemfile
Partial Build Log