Hi fellow rubyists,

I have a question about the role of bundler when creating a gem. I'm
familiar with bundler and the way that it handles dependencies in a
rails app, but I've run into a few snags with using it to manage
dependencies for gems that I've created.

In a gemspec you can use `add_dependency` to include other gems as a
dependency for your gem. Random example:

  Gem::Specification.new do |gem|
    #...
    gem.add_dependency 'json'
  end

That means that installing my gem will also install json (if it doesn't
exist).

  $ gem install mygem
  Successfully installed json-x.x.x
  Successfully installed mygem-x.x.x

However, creating a gem with `bundle new` seems to want you to specify
dependencies in the Gemfile. So, if I do that:

  # Gemfile
  gem 'json'

And leave out the `add_dependency` in the gemspec, it doesn't install
the dependencies when I run gem install:

  $ gem install mygem
  Successfully installed mygem-x.x.x

So is it possible to specify gem dependencies with bundler? Or is it
just for development purposes?

Thanks in advance.

-- 
Posted via http://www.ruby-forum.com/.