configuration of blazer for localhost

32 Views Asked by At

The blazer gem installation instructions indicate

For production, specify your database:

ENV["BLAZER_DATABASE_URL"] = "postgres://user:password@hostname:5432/database"

in local development, the following error is being generated nonetheless

ActionView::Template::Error (undefined method `each' for nil:NilClass

      settings["data_sources"].each do |id, s|

thus the data source needs to be set in config/blazer.yml

postgresql logs indicate

2024-01-14 10:14:44.406 CET [1978] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2024-01-14 10:14:44.407 CET [1978] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"

yet the following configuration

data_sources:
  main:
    url: "postgres://[email protected]:[email protected]:5432/boilerauth_development"

still generates a complaint URI::InvalidURIError (bad URI(is not URI?): "postgres://[email protected]:[email protected]:5432/boilerauth_development"):

where is this configuration mistaken?

1

There are 1 best solutions below

0
On BEST ANSWER

When you have a special character in your username or password then you need to URI encode it. So you want to have kk%40example.com as your username in your connection string:

    url: "postgres://kk%40example.com:[email protected]:5432/boilerauth_development"