Hi,

A lot of gems are included in Gemfile.
Only some of them are required in config.rb. Susy for example. But not Singularity.
Why is that ? Why do some gems need to be required in compass config and other don't ?

Comments

fubhy’s picture

Hi.

Them gems listed in the Gemfile by default are just what comes with the starterkit. It is just a starting point and something you should adjust to your needs. Same with the config.rb. For example, it probably makes no sense to run both, Singularity and Susy side-by-side. Hence, it's probably a good idea to remove the one you don't plan to use. At my agency we have a custom Omega Subtheme that provides a custom Starterkit that we use for our projects. It comes with a completely different Gemfile and config.rb and also doesn't come with Guard/Grunt but Gulp instead. The default Starterkit is just a starting point really. It also makes no sense to run Guard AND Grunt and Gulp. Choose the one you like the most. Guard is probably the easiest one to set up (just requires Ruby and the accompanying gems), while Gulp and Grunt both require Node and NPM and a couple of NPM packages. Grunt is configuration, Gulp is code (much like Node syntax). Still, we prefer Gulp because we find it easier to read and maintain and adjust to our needs.

So... Feel free to adjust your sub-theme to your needs or even set up a custom starterkit that you can then use for all your projects which is more fine-tuned and tailored for your needs.

Personally, I like to see Omega as a bridge/advertiser for modern front-end tools and techniques. It might be a little overwhelming at first but we really wanted to pre-configure a couple of these tools with some sample configuration so people get used to it and start to use whatever they like most. Hence the variety and partly duplication of tools. Once you made your choice, remove what you don't need. :)

Nicolas Bouteille’s picture

Thank you for the quick answer!
Unfortunately I'm still confused here... let me rephrase my question:
I understand that if I want to use Singularity I don't need Susy or if I use Guard I don't need Grunt... all this is logical :)
What I don't understand is why some gems do need to be required in config.rb and some others just need to be added to Gemfile.
Breakpoint for example is not required in config.rb, it is just in Gemfile and imported in style.scss and it works.
I see Susy must be required in config.rb to work but Singularity does not since it is only imported in style.scss not required in config.rb and actually works.
To make autoprefixer-rails work I had to add it to Gemfile + require in config.rb

I would like to be able to understand which gems I need to require in config.rb and those I don't.

Thanks Nick

fubhy’s picture

Ah, right. So that boils down to whether the Gem only provides Sass functionality (mixins, etc.) or also actual Ruby functions that said Sass functionality depends on. No Ruby functions => No include in config.rb required.

Nicolas Bouteille’s picture

Status: Active » Closed (works as designed)

Thank you sir!

fubhy’s picture

I would like to be able to understand which gems I need to require in config.rb and those I don't.

If the Gem installation instructions tell you to also add it to config.rb, you should (that means it needs to access some Ruby functionality to function properly). If it doesn't it's not required (and consequently doesn't have any custom Ruby dependencies.