Gem dependencies are not autoloaded as opposed to using Bundler/Gemfile. Thus, you'll have to require
the gems that you depend upon.
How do i get rspec to read the dependencies in my gemspec?
Вопрос
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
Решение
Не связан с StackOverflow