Bundler.require not loading .gemspec dependencies #2018
Comments
Gems must load their own dependencies. If they don't, they are no longer functional Rubygems. On Jul 6, 2012, at 5:05 PM, Jerry Cheungreply@reply.github.com wrote:
|
Additional note: |
Thanks for the clarification! |
Can you explain what this means, to someone who is unfamiliar with this process? |
@ifreecarve no problem. Gems are not able to use Bundler, so they should simply |
By this you mean that in whatever ruby source files are contained in the gem, you say (I was able to solve the problem I was having, but I have no idea how.) |
Not exactly. When you create a gem, list any other gems you depend on in your gemspec. Then, inside the code of your gem, require those gems. So, if your gem depends on Rack, you would add a line like Bundler will use the gemspec to know what to install and add to the load path; your gem will then require it and be able to use it. On Wed, May 20, 2015 at 12:06 PM, Ian notifications@github.com wrote:
|
Hmm... that's what I was doing. Bundler seemed to be ignoring what i put in |
@indirect would this potentially change now that |
No, this behavior is not changing. |
I'm not sure if this is intentional behavior, but from this documentation, I expected that
Bundler.require :default
would also require the runtime dependencies specified in .gemspec. I've created a demo gem showing this.If I explicitly require rack, it works as expected, and Gemfile.lock lists rack as expected.
The text was updated successfully, but these errors were encountered: