I just created a new gem (using bundler) and want to add Active Record support. So I added
s.add_dependency "activerecord", "~> 3.0"
Firstly, if you're packaging a gem, do not use
Bundler.require is for apps not gems.
.gemspec, specify the dependencies of your deployed gem.
Gemfile, include the line
gemspec to automatically include the dependencies listed in your
.gemspec in your
You may also optionally create gem groups for dev and test.
In your code, explicitly
require any libraries you need.
I lost a couple of hours on this today so I hope this helps.
Secondly, though the ActiveRecord gem is called "activerecord", the lib is called "active_record". This is what you would need in
gem 'activerecord', :require => "active_record"
Unless you include the
:require option, ActiveRecord won't be loaded correctly and you won't know about it until you try to use it.