我在使用Docker运行的Rails项目上遇到红宝石时遇到了问题。我直觉这与运行macOS Catalina(10.15.1)有关。当我尝试docker-compose run web rake db:create
时就会出现问题。
运行docker-compose run web rake db:create
时得到以下输出:
Starting vft_db_1 ... done
PG::InvalidParameterValue: ERROR: invalid value for parameter "client_min_messages": "panic"
HINT: Available values: debug5, debug4, debug3, debug2, debug1, log, notice, warning, error.
: SET client_min_messages TO 'panic'
/usr/local/bundle/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `async_exec'
/usr/local/bundle/gems/activerecord-
...
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "host"=>"db", "username"=>"postgres", "password"=>nil, "pool"=>5, "database"=>"vft_test", "client_min_messages"=>"warning"}
这是我的database.yml
default: &default
adapter: postgresql
encoding: unicode
host: db
username: postgres
password:
pool: 5
development:
<<: *default
database: vft_development
min_messages: warning
test:
<<: *default
database: vft_test
min_messages: warning
(我也尝试过client_min_messages: warning
,但遇到了同样的问题)
当我运行$ docker version
时,我得到:
Client: Docker Engine - Community
Version: 19.03.5
API version: 1.40
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:22:34 2019
OS/Arch: darwin/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.5
API version: 1.40 (minimum version 1.12)
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:29:19 2019
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.2.10
GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339
runc:
Version: 1.0.0-rc8+dev
GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
docker-init:
Version: 0.18.0
GitCommit: fec3683
谢谢!