Rails logs after make some change:
[DEV]: Edited files which are not autoloaded. Restarting server...
- app/controllers/admin/admin_controller.rb
RESTARTING UNICORN
I, [2025-09-19T16:35:33.289558 #1735] INFO -- : reaped #<Process::Status: pid 2207 exit 0> worker=0
I, [2025-09-19T16:35:33.289638 #1735] INFO -- : reaped #<Process::Status: pid 2214 exit 0> worker=1
I, [2025-09-19T16:35:33.289701 #1735] INFO -- : reaped #<Process::Status: pid 2226 exit 0> worker=2
I, [2025-09-19T16:35:33.289718 #1735] INFO -- : master complete
TRANSACTION (0.1ms) BEGIN
In another terminal, if I send a request, curl
just hangs:
$ curl 127.0.0.1:3000
# nothing happens
In terminal where I ran bin/rails s
, I need to type ctrl + c
:
Flushed 2 metrics
^CGot INT signal
Shutting down
Terminating quiet threads for default capsule
Scheduler exiting...
Firing quiet event
Firing shutdown event
Pausing to allow jobs to finish...
Bye!
I, [2025-09-19T16:39:36.317846 #4843] INFO -- : Refreshing Gem list
Starting CSS change watcher
TranslationOverride Pluck (0.4ms) SELECT "translation_overrides"."translation_key", "translation_overrides"."value" FROM "translation_overrides" WHERE "translation_overrides"."locale" = 'en'
Now, in the second terminal curl
works as expected:
$ curl 127.0.0.1:3000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Discourse</title>
<meta name="description" content="">
Things i tried
The devcontainer.json has:
"image": "docker.io/discourse/discourse_dev:20250307-0016",
I changed my devcontainer.json
local to:
"image": "docker.io/discourse/discourse_dev:release",
That did not solve the problem.
In config/environments/development.rb
config.file_watcher = ActiveSupport::FileUpdateChecker
That also did not solve the problem.
Steps I use to start rails server:
cd discourse
code . # select "open folder in container"
I do not use vscode tasks, so in another terminal i run:
docker exec -ti -u discourse $ID bash
cd workspace/discourse/
bin/rail s
Also, I was expecting the app
folder to be inside config.autoload_paths
, but it is not:
bin/rails console
Loading development environment (Rails 8.0.2.1)
[1] pry(main)> Rails.application.config.autoload_paths
=> ["/workspace/discourse/lib", "/workspace/discourse/lib/guardian", "/workspace/discourse/lib/i18n", "/workspace/discourse/lib/validators"]