views:

14

answers:

1

I just created a new gem (using bundler) and want to add Active Record support. So I added s.add_dependency "activerecord", "~> 3.0" to my gemspec. Then I use Bundler.setup and Bundler.require and thought that I have access to Active Record now, but I haven't. I have to explicitly use require "active_record". Any idea why Bunder.require does not work for me in that case?

+1  A: 

If you want use Bundler you need define your Gemfile with Activerecord

gem 'activerecord', "~> 3.0.0"

Or you need define bundler to use your gemspec with adding gemspec in your Gemfile

gemspec

See http://gembundler.com/rubygems.html

shingara
There is already gemspec in my Gemfile (bundler does that automatically for newly created gems), so that is not the problem.
Zardoz