You will need to have a database named pg_search_test that the currently logged in user is able to access.
For my setup (which is PostgreSQL built by Homebrew, with default configuration) I'm able to run exactly this on the command line:
$ created pg_search_test
But the only reason it works is that my currently-logged-in user is marked as a superuser in PostgreSQL. I had already done this by running
$ createuser -s [my user name]
Now if you don't have the right permissions to control your database, then you'll have to do something different.
Note that I show the createdb message for any failure to connect to the database, as it's the most likely fix. If you post more of the exception (with backtrace), we might be able to figure out if something else is a problem.
Grant