I know this is an old question, but I found it using Google, so others may be here.
In my Mac OSX macports install, I had two folders with .so files for postgresql:
/opt/local/lib/postgresql90/
and
/usr/local/pgsql-9.0/lib/
It seems that my installation looked in / opt / local / lib / postgresql 90 /, and not in / usr / local / pgsql -9.0 / lib /, so I had to do the following to install pg_trgm:
sudo ln -s /opt/local/lib/postgresql90/pg_trgm.so /usr/local/pgsql-9.0/lib/
This should work with any .so file that is not in the right place.
source share