Skip to content


LoadError (no such file to load -- pg_search/features/dmetaphone): #78

rmontgomery429 opened this Issue · 6 comments

3 participants


This may very well be a Heroku issue but I thought I'd post it here in case others run into the same thing.

I'm running using their Crane database which should be Postgres 9.2.
I'm using the following: pg_search_scope :search_by_description, :against => :description, :using => { :tsearch => {:any_word => true} }

This works locally and has been working in the past although I recently upgraded my database to the Crane database.

The error I am receiving is "LoadError (no such file to load -- pg_search/features/dmetaphone):"

Any insights?


Just to note that I see dmetaphone requires a contrib package but I'm not using that so maybe my new question is "why is something trying to load pg_search/features/dmetaphone?".


Ok. So just to try something I ran this migration.

class AddFuzzyStrMatchToPostgres < ActiveRecord::Migration
  def up
    execute "CREATE EXTENSION pg_trgm;"
    execute "CREATE EXTENSION fuzzystrmatch;"

  def down
    execute "DROP EXTENSION pg_trgm;"
    execute "DROP EXTENSION fuzzystrmatch;"

Now I get:

NameError (undefined local variable or method 'rank' for #<PgSearch::ScopeOptions:0x00000008965278>):


Ok...... so I "fixed" it. So I tried accessing Heroku by running heroku run bash and then rails console. This failed because of the following error: cannot load such file — test/unit/testcase (LoadError). I wasn't really sure why that was failing at first but this stackoverflow post had a suggestion. Remove test from the .slugignore file.

I removed test from my .slugignore file and was then able to run rails console. To my surprise when I got in the rails console to debug the pg_search issue... it was gone!

So my thought is that the testcase load issue was preventing something from loading in pg_search? Maybe?


I'm using 0.5.7


@rmontgomery429 is this still valid? please close the issue if not. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.