We are extracting a few models into a gem so it can be shared among a couple different services and we aren’t able to get rspec running in the gem. When we require the gemname in the spec_helper it errors saying:
uninitialized constant Object::ActiveRecord
Some of the file contents are below. Any ideas?
Right now the spec helper is as follows:
require 'rubygems'
require 'bundler/setup'
RSpec.configure do |config|
Bundler.require(:default,"test")
require 'tup-user' # and any other gems you need
end
Our Gemfile is:
source :rubygems
# Specify your gem's dependencies in tup-user.gemspec
gemspec
gem 'rspec-rails'
gem 'aasm'
gem 'authlogic'
gem 'rails'
The line the error is being thrown on is the first of the class:
class User < ActiveRecord::Base
(See comments to question) After getting some good advice on the ruby-talk mailing list, I now require any libraries a file needs within the file itself.