Erro ao roda o db:migrate

quando execuato RAILS_ENV=production bundle exec rake db:migrate

recebo o seguinte erro

Tilt::LessTemplate is deprecated, consider switching from LESS to SCSS
Deprecation warning: Expected string default value for '--serializer'; got true (boolean).
This will be rejected in the future unless you explicitly pass the options `check_default_type: false` or call `allow_incompatible_default_type!` in your code
You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.
rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/postgresql_adapter.rb:686:in `configure_connection'
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/postgresql_adapter.rb:674:in `connect'
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/postgresql_adapter.rb:217:in `initialize'
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `new'
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:729:in `new_connection'
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:773:in `checkout_new_connection'
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:752:in `try_to_checkout_new_connection'
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:713:in `acquire_connection'
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:490:in `checkout'
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:364:in `connection'
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:883:in `retrieve_connection'
/usr/share/rvm/gems/ruby-2.4.10/bundler/gems/activerecord-connections-22c6a47dbc01/lib/active_record/connections.rb:63:in `retrieve_connection'
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/connection_handling.rb:91:in `connection'
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:1118:in `initialize'
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:1006:in `new'
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:1006:in `up'
/usr/share/rvm/gems/ruby-2.4.10/gems/activerecord-5.0.7.2/lib/active_record/migration.rb:984:in `migrate'
/home/idiario/i-diario/lib/tasks/database.rake:9:in `block (2 levels) in <top (required)>'
/usr/share/rvm/gems/ruby-2.4.10/gems/rake-13.2.1/exe/rake:27:in `<top (required)>'
/usr/share/rvm/gems/ruby-2.4.10/bin/ruby_executable_hooks:22:in `eval'
/usr/share/rvm/gems/ruby-2.4.10/bin/ruby_executable_hooks:22:in `<main>'
Tasks: TOP => db:migrate => db:migrate_dbs
(See full trace by running task with --trace)

quando rodo o comando RAILS_ENV=production bundle exec rails server -b 0.0.0.0 -p 8080
tenho esse output


Tilt::LessTemplate is deprecated, consider switching from LESS to SCSS
=> Booting Puma
=> Rails 5.0.7.2 application starting in production on http://0.0.0.0:8080
=> Run `rails server -h` for more startup options
Deprecation warning: Expected string default value for '--serializer'; got true (boolean).
This will be rejected in the future unless you explicitly pass the options `check_default_type: false` or call `allow_incompatible_default_type!` in your code
You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.
Puma starting in single mode...
* Puma version: 6.4.3 (ruby 2.4.10-p364) ("The Eagle of Durango")
*  Min threads: 0
*  Max threads: 5
*  Environment: production
*          PID: 10582
* Listening on http://0.0.0.0:8080
Use Ctrl-C to stop