Blazer gem安装说明 表明
For production, specify your database:
ENV["BLAZER_DATABASE_URL"] = "postgres://user:password@hostname:5432/database"
在本地开发中,仍然会生成以下错误
ActionView::Template::Error (undefined method `each' for nil:NilClass
settings["data_sources"].each do |id, s|
因此需要将数据源设置为config/blazer.yml
postgresql 日志表明
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"
还有以下配置
data_sources:
main:
url: "postgres://[email protected]:[email protected]:5432/boilerauth_development"
仍然产生投诉
URI::InvalidURIError (bad URI(is not URI?): "postgres://[email protected]:[email protected]:5432/boilerauth_development"):
这个配置哪里错了?
当您的用户名或密码中有特殊字符时,您需要对其进行 URI 编码。因此,您希望
kk%40example.com
在连接字符串中包含用户名: