我已經使用GCP幾天了,但我正努力讓我的Ruby on Rails應用程序連接到託管在Cloud SQL上的Postgres。谷歌App Engine + Postgres雲SQL連接問題
我已經設法通過雲SQL代理本地連接並執行遷移,但我還沒有得到過去。
這是我的database.yml生產設置。
production:
<<: *default
adapter: postgresql
database: databasename
username: databaseuser
password: databasepassword
host: /cloudsql/project-name-172409:us-central1:application-name
這是我的app.yaml設置。
runtime: custom
env: flex
health_check:
enable_health_check: false
beta_settings:
cloud_sql_instances: project-name-172409:us-central1:application-name
env_variables:
SECRET_KEY_BASE: 121212
我的自定義docker文件繼承自基礎ruby構建並執行遷移。
我得到的錯誤是這樣的。
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
你知道這是什麼問題嗎? – Hendrik