新手问题 新手问题:Gemfile 里面添加 Gem,为什么有的单独写,有的 group :assets???

superbatironmans5 · July 06, 2012 · Last by cqpx replied at July 06, 2012 · 2965 hits

只为 assets 的 Gems,并且默认在生产环境里不需要?这是神马意思

只在编译 assets 的时候加载,下面 test 组和 development 组也是分别对应不同的场景

rake assets:precompile 的时候你仔细看它的命令

rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets

这里会用到 assets groups 生产环境因为已经编译好了 assets 了,不再需要这些 assets 用的 gem,所以不包含在生产环境里

You need to Sign in before reply, if you don't have an account, please Sign up first.