My environment come without PostgreSQL pre-installed and for this reason I had a error:
Could not find pg-1.2.3 in any of the sources
And to solve this I need to run the command (source: https://medium.com/@hidayatabisena/solving-issues-could-not-find-gem-pg-0-18-when-creating-postgresql-db-in-macosx-high-sierra-2efed94db48e):
brew install postgres
After that I could just follow the gist https://gist.github.com/eliotsykes/10cf6f1557556e5cafcc857792e63fff