Should a Gem's dependencies be listed in the parent app's Gemfile?

I am working on a Gem that has several Gem dependencies of its own.
The Gem’s .gemspec looks good (I think) and when “bundle install” is
called from the parent app, it lists that it is indeed “Using” the
Gem’s required Gems. I’ll refrain from an Inception analogy here :wink:

When I fire up the app and make a request, I get “uninitialized
constant Authlogic” (this is one of the Gem’s dependencies). If I add
“gem ‘authlogic’” to the app’s Gemfile all is good.

I was under the impression that a Gem’s dependencies did not need to
be added to the parent app’s Gemfile. Am I wrong here? Do I need to
configure something differently in my Gem so that the explicit Gemfile
calls are not needed?

Thanks, Elliott G

I had failed to require the Gem’s dependencies in the Gem’s init
(my_gem_name.rb) lib file. A simple require ‘authlogic’ did it.

Elliott G

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs