3 ms·
> Rails 4.0 removed the assets group from Gemfile. You'd need to remove that line from your Gemfile when upgrading. Can anyone explain or provide a cite to mor
by jrochkind1 14y ago
> Rails 4.0 removed the assets group from Gemfile. You'd need to remove that line from your Gemfile when upgrading.
Can anyone explain or provide a cite to more on this? What the intention is here, what one is supposed to do with gems only used in asset compilation but not needed in actual production app environment?
- steveklabnik 14y agoTwo things: 1) Sprockets integration was totally re-written, with huge performance benefits. It's now sprockets-rails. 2) Before, to precompile, you did this: bundle exec rake assets:precompile Now, you do this: RAILS_ENV=production bundle exec rake assets:precompile I'm not sure of the details of what changed about this, but basically, it was that you did need assets in all environments anyway, so the group is no longer needed.
- jrochkind1 14y agoThanks for more details -- is this documented anywhere yet? If not, it might be good to add to the "docs needed" checklist. (Also, if when migrating an app from 3 to 4 you need to manually add 'sprockets-rails' to your Gemfile, should be mentioned in migration guide) It seems unfortunate to me that all those gems involved only in asset compiling now need to be in every environment -- meaning they need to actually be loaded and 'require'd in your production running app, even though assets have already been compiled. Hopefully that change to requirements was needed to reap some worthwhile benefit, it's still pretty sketchy to me why the sprockets integration improvements led to this change.
- steveklabnik 14y agoI am not 100% sure. I'll talk to the people in charge of the asset pipeline and get it in there. > it's still pretty sketchy to me why the sprockets integration improvements led to this change. Sprockets is one of the parts of Rails I know least about, so yeah, I'm not sure why this decision was made. But explaining it somewhere for posterity is a good thing, absolutely.