How do i get rspec to read the dependencies in my gemspec?

gemspecs, rspec

Solution

Gem dependencies are not autoloaded as opposed to using Bundler/Gemfile. Thus, you'll have to `require` the gems that you depend upon.

Problem

When I run 'rspec' or 'bundle exec rspec' it doesn't let me use the dependencies in my .gemspec file. Do I have to repeat myself and break the DRY principle and display my gems in Gemfile and .gemspec?? (ps. I am doing this for my models files as a rails engine) Gemfile: ``` gemspec ``` .gemspec: ``` s.add_dependency "rails", "~> 3.2.13" s.add_dependency "mongoid" s.add_dependency "mongoid_commentable" ``` Example: "bundle exec rspec" Displays errors: ``` uninitialized constant Mongoid::Commentable uninitialized constant Comment::Mongoid_Commentable uninitialized constant Mongoid::Commentable ```

Original source