Diesel setup fails

Following this tutorial:
https://diesel.rs/guides/getting-started

after

diesel setup

I'm getting:

thread 'main' panicked at /home/user/.cargo/registry/src/diesel_cli-2.1.1/src/database.rs:358:48:
called Result::unwrap() on an Err value: InvalidPort
stack backtrace:
0: rust_begin_unwind
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
1: core::panicking::panic_fmt
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
2: core::result::unwrap_failed
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/result.rs:1649:5
3: diesel::database::change_database_of_url
4: diesel::database::setup_database
5: diesel::main

The error says that a port is invalid. Completely don't know what to do about it.
Could somebody try to help me with this?

[EDIT]
Also this line helped me:

diesel setup --database-url postgres://myuser:mypassword@localhost/mydb

What database url are you using? (don't include your password)

echo DATABASE_URL=postgres://user:pass@localhost/diesel_demo > .env

Ok, I've managed to connect to a database. The issue was pg_hba.conf file with ident instead of md5.
For others, please follow this advice:

Specifically:

sudo gedit /var/lib/pgsql/data/pg_hba.conf

and edit host all all 127.0.0.1/32 ident to host all all 127.0.0.1/32 md5. This should allow most applications to connect with username/password.