'-e:5:in `<main>': undefined method `[]' for nil:NilClass (NoMethodError)

My objective is to insert one line in a file inside a docker container, sometimes it's working smoothly sometime the docker takes restarts frequently and from the docker logs I am getting this error

-e:5:in <main>': undefined method []' for nil:NilClass (NoMethodError)

here is the copy of config/database.yml

development:
  adapter: postgresql
  database: redmine_test
  host: localhost
  username: postgres
  password: "postgres"
  pool: 20 - Added this line


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source