I'm having the same issue as this link but none of the solutions here are working. A couple hours of searching and of course reading the main Rails Engine docs have all turned up the same strategies as the SO link. I'm wondering if there is something different about the way Rails 5 handles dependencies.
I have this dependency in my gemspec:
s.add_development_dependency "pg_search"
I have this line in my engine.rb file:
require "pg_search"
When I run rails s from within the engine's directory, everything loads fine. When I mount the engine and try to start the server from the rails app directory, I get this error:
/home/andy/.rvm/gems/ruby-2.3.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require': cannot load such file -- pg_search (LoadError).
Finally, if I add the pg_search gem to the Gemfile of the app that is mounting the engine, the rails server starts. This of course isn't a solution, I'm just trying to provide complete information.