bobby blogging

Tricky Gem Dependencies

Some gems are easier to use than others. Those with tricky capitalization or non-standard characters (like forward slashes) can make trouble in an opinionated system like Rails. Luckily, overrides are almost always available (but not necessarily easy to find). Gems like RedCloth and test/spec have caused problems for me with config.gem, but then I found the :lib option on a spanish blog:

config.gem "test-spec", :lib => "test/spec", :version => ">= 0.4.0"

See the difference? The first var is the name you use to install the gem and the second is the name used to require it.