You can do this quite easily in rails 3.1+ if you make your gem an engine of rails. Among other things, if you add assets to the engine, you can require these CSS files from application manifest files, etc.
See how to do it here and quite a few stones that wrap js / CSS packages for this exact purpose, the ability to update used assets without running generators or anything else. For example, jquery-rails gem does this for jquery. A more complex example is jquery-ui-rails, which combines all jquery ui js, CSS, images, etc. And it allows you to load only jquery ui components that you really need.
source
share