Gemfile, the asset pipeline: Why have the group :assets in your Gemfile?

68 views
Skip to first unread message

David Zhang

unread,
Jul 21, 2011, 12:06:02 PM7/21/11
to rubyonra...@googlegroups.com
Heroku, as shown here - http://devcenter.heroku.com/articles/rails31_heroku_cedar - shows a Gemfile in which the following exists:

# Asset template engines
group :assets do
  gem 'sass-rails', "~> 3.1.0.rc"
  gem 'coffee-script'
  gem 'uglifier'
end

I don't understand why these gems are grouped.  Why not omit the group :assets do ... end? What does this do, exactly?

I'm asking because something really peculiar happened: I get the "Sass Syntax Error: File to import not found or unreadable..." when the imports definitely should work. When I remove the group :assets, run "bundle install", and then check rails server, the imports work fine again. And here's the oddest of all: when I revert my Gemfile back to having the group :assets as above, and then run rails server - the imports still work although my Gemfile was back to what it was when the imports didn't work. Thoughts appreciated.

(Btw, I use Rails 3.1rc4, and I'm trying to deploy to Heroku asap)

NARKOZ

unread,
Aug 4, 2011, 7:11:54 AM8/4/11
to rubyonra...@googlegroups.com
You don't need this gems in production
Reply all
Reply to author
Forward
0 new messages