diesel: diesel_cli connection info string error

I’m trying to set up a new database using diesel_cli, but I get the following error:

$ diesel setup --database-url postgres://myuser:mypassword@localhost/mydb
Creating database: mydb
missing "=" after "postgres://myuser:mypassword@localhost/postgres" in connection info string

I’m not sure where I should put the = sign, especially since the connection info string reported in the error refers to the postgres database, whereas the database URL I specified refers to the database I’m trying to initialize… Thanks for any pointers!

Versions

  • Rust: 1.22.0-nightly
  • Diesel: 0.16.0
  • Database: PostgreSQL 9.6.5
  • Operating System Ubuntu 12.04.5 LTS

Feature Flags

  • diesel_cli: sqlite, postgres

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 15 (9 by maintainers)

Most upvoted comments

Also just to confirm, you’re seeing this error message when using exactly the URL postgres://myuser:mypassword@localhost/mydb?

yes

Can you provide the output of otool -L $(which diesel) or the equivalent command on your OS to show the shared libraries used in the diesel binary?

This was good thinking, thank you very much! I did ldd $(which diesel) and it dawned on me based on the output that I’d compiled diesel against my custom-installed version of various libraries sitting alongside the sqlite and postgres libraries, but at runtime, diesel was finding the system versions of those 😃

So thanks again, after setting LD_LIBRARY_PATH, everything works as expected. The error must have been the result of some weird interaction with the older versions of the libraries. Closing.

Can you confirm that you installed diesel_cli with PG support enabled? (Either by doing cargo install diesel_cli or `cargo install diesel_cli --no-default-features --features “postgres”)