From e022e8dbfbec64910e4718d9e930667401c3a391 Mon Sep 17 00:00:00 2001 From: Emi Dunn-Rankin Date: Thu, 26 Oct 2023 00:04:20 +0000 Subject: [PATCH] Oops, fix bugs in dev container setup! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I missed two things: 1) `rake` wasn't available in the path (surprising but ok!), so I replaced it with the more modern and more portable `bin/rails` invocation. 2) Without specifying a `host`, Rails was trying to connect with the database over a socket instead of over a port. Here, we tell it where to actually connect! I think I'll need to make some tweaks here, since this isn't compatible with my _own_ local setup—maybe I'll revert `database.yml`, and have the dev container use the `DATABASE_URL` environment variable to override it? But whatever, this is working for now, and that's exciting to me! Note: On my machine, the install step hangs for a loooong time, to the point where I usually give up. On Codespaces, it also took a while at the same step (`Installing devise-encrpytable`), but eventually got through it. Maybe on my machine it would work if I'm more patient? Idk! But it's good to see it working on something!! --- .devcontainer/post-create.sh | 2 +- config/database.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 1828c430..d27e4297 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -10,4 +10,4 @@ git config --global safe.directory '*' bundle install # Set up the databases: create the schema, and load in some default data. -rake db:schema:load db:seed +bin/rails db:schema:load db:seed diff --git a/config/database.yml b/config/database.yml index e57ed12f..2fbc7152 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,6 +1,7 @@ development: primary: adapter: mysql2 + host: db database: openneo_impress username: impress_dev password: impress_dev @@ -10,6 +11,7 @@ development: openneo_id: adapter: mysql2 + host: db database: openneo_id username: impress_dev password: impress_dev