There’s no need for you to do this.

psql -U your_username -d your _database_name < path_to_your_dump_file.sql

Just take the simplest approach.

bin/rails db < path_to_your_dump_file.sql
Share: