When do I need it to specify?
What should I specify? I know that I need to put the name of the
library, but the name is always the same with the gem name?
Also do I need to add "require 'the_library'" when I actually use it
somewhere in Rails? Or does the config.gem() runs "require" statement
as well?
rails automatically requires a gem loaded by config.gem. how does
rails know what to require? That's what you specify with :lib. If you
do not specify :lib, rails tries to require the name of the gem.
so, for example requiring the simple-navigation gem:
config.gem 'simple-navigation'
tries to require 'simple-navigation', which does not work, so you have
to specify
Another instance where you will need to explicitly use the :lib option
is for gems you download and install from GitHub, where gem names are
typically prefixed with the author's name:
Another instance where you will need to explicitly use the :lib option
is for gems you download and install from GitHub, where gem names are
typically prefixed with the author's name:
this ensures they are installed, but will not load them
When you bootstrap the Rails environment (server, console, runner, etc.) it won't "require" any gems that have ":lib => false" specified, but Rails still "knows" about these gems, so things like "rake gems:install" still work as expected.