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:
psql -U your_username -d your _database_name < path_to_your_dump_file.sql
bin/rails db < path_to_your_dump_file.sql
Tell us about it. We'll tell you how we can help — honestly.