IN TOTAL AMOUNT:
The PgSearch module provided by Gem pg_search cannot be enabled, needed, or downloaded in an intermediate environment (Rbenv, nginx, unicorn, capistrano), the problem occurs on the web server via http, but the command does not appear on the intermediate servers. Another module provided by another stone can be included without errors.
There are no problems in the local development environment (rvm, puma).
DETAILS
I am currently developing a Ruby On Rails 4.0 application with ruby ââ2.0.0, where git repositories are hosted on a bitpack. I am deploying the application through an intermediate server using capistrano.
- Intermediate Server Environment: rbenv, nginx and unicorn
- Local development environment: rvm and puma
The rails environment files (environment / production.rb and environment / staging.rb) are the same for both.
WHAT TO DO:
I installed the pg_search pearl (PostgreSQL full-text search stone), adding it to my Gemfile and placing the "include PgSearch" sentence in the active record model that I wanted to use with pg_search gem
I launched the application in development mode ... it works!
PROBLEM:
After deploying the changes to the staging server: Through the HTTP server, I get this error:
NameError in application :: MyController # index Uninitialized constant MyActiveRecordModel :: PgSearch
(Usually, this pg_search pearl, which is included in the GemFile, must have its lib / *. Rb files included in the startup search path, and the load sentence "pg_search.rb" require "pg_search" or enable PgSearch " (module included in pg_search.rb file).
To find hints to fix the error, I have:
-tried if another module provided by the gem can be turned on ... It works
After navigating to the current intermediate server release path, I run "bundle exec rails c staging" and tried:
See if the ActiveRecord Model feature (which is included in PgSearch) is working.
see if it is possible to find / download the module provided by the stone on the server and I performed - turn on PgSearch and require "pg_search" and load "pg_search.rb".
All of these teams have been successful.
I'm running out of ideas to find some other clues, do you have any suggestions?
Thanks.