# Current\_hostname: 초기화되지 않은 상수

**URL:** https://meta.discourse.org/t/current-hostname-uninitialized-constant/225742
**Category:** Self-hosting
**Tags:** unsupported-install
**Created:** [4월 30, 2022, 10:07오전 UTC](https://meta.discourse.org/t/current-hostname-uninitialized-constant/225742 "2022-04-30T10:07:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![gdude2002](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gdude2002/32/258537_2.png) [@gdude2002](https://meta.discourse.org/u/gdude2002)
#### Post date: [4월 30, 2022, 10:07오전 UTC](https://meta.discourse.org/t/current-hostname-uninitialized-constant/225742/1 "2022-04-30T10:07:02Z")

</div>

안녕하세요! 포럼을 호스팅하기 위해 k8s를 사용해야 하므로 설정이 다소 복잡한데, 최대한 간결하게 설명하겠습니다.

[이 application yml](https://github.com/QuiltMC/forum.quiltmc.org/blob/main/containers/quiltmc.yml)을 사용할 때 시작 과정에서 다음과 같은 오류가 발생합니다. 이는 지난밤부터 새로 발생한 문제입니다. 그전까지는 정상적으로 작동하고 있었지만, 갑자기 다시 배포하니 문제가 생겼습니다.

해당 yml 파일에서 이메일 환경 변수를 수정한 부분은 신경 쓰지 마세요. 다른 문제를 디버깅 중이었습니다.

```plaintext
=> Booting Puma
=> Rails 7.0.2.4 application starting in production 
=> Run `bin/rails server --help` for more startup options
Exiting
/var/www/discourse/lib/discourse.rb:443:in `current_hostname': uninitialized constant Discourse::SiteSetting (NameError)
Did you mean? Discourse::SiteSettingMissing
        from /var/www/discourse/config/initializers/100-verify_config.rb:7:in `<main>'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in `load'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:39:in `load'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/engine.rb:667:in `block in load_config_initializer'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activesupport-7.0.2.4/lib/active_support/notifications.rb:208:in `instrument'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/engine.rb:666:in `load_config_initializer'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/engine.rb:620:in `block (2 levels) in <class:Engine>'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/engine.rb:619:in `each'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/engine.rb:619:in `block in <class:Engine>'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/initializable.rb:32:in `instance_exec'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/initializable.rb:32:in `run'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/initializable.rb:61:in `block in run_initializers'
        from /usr/local/lib/ruby/2.7.0/tsort.rb:228:in `block in tsort_each'
        from /usr/local/lib/ruby/2.7.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /usr/local/lib/ruby/2.7.0/tsort.rb:422:in `block (2 levels) in each_strongly_connected_component_from'
        from /usr/local/lib/ruby/2.7.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /usr/local/lib/ruby/2.7.0/tsort.rb:421:in `block in each_strongly_connected_component_from'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/initializable.rb:50:in `each'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/initializable.rb:50:in `tsort_each_child'
        from /usr/local/lib/ruby/2.7.0/tsort.rb:415:in `call'
        from /usr/local/lib/ruby/2.7.0/tsort.rb:415:in `each_strongly_connected_component_from'
        from /usr/local/lib/ruby/2.7.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /usr/local/lib/ruby/2.7.0/tsort.rb:347:in `each'
        from /usr/local/lib/ruby/2.7.0/tsort.rb:347:in `call'
        from /usr/local/lib/ruby/2.7.0/tsort.rb:347:in `each_strongly_connected_component'
        from /usr/local/lib/ruby/2.7.0/tsort.rb:226:in `tsort_each'
        from /usr/local/lib/ruby/2.7.0/tsort.rb:205:in `tsort_each'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/initializable.rb:60:in `run_initializers'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/application.rb:372:in `initialize!'
        from /var/www/discourse/config/environment.rb:7:in `<main>'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
        from config.ru:6:in `block in <main>'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `eval'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in `new_from_string'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:105:in `load_file'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in `parse_file'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:349:in `build_app_and_options_from_config'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:249:in `app'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:422:in `wrapped_app'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:312:in `block in start'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:379:in `handle_profiling'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rack-2.2.3/lib/rack/server.rb:311:in `start'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/commands/server/server_command.rb:38:in `start'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/commands/server/server_command.rb:143:in `block in perform'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/commands/server/server_command.rb:134:in `tap'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/commands/server/server_command.rb:134:in `perform'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/command/base.rb:87:in `perform'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/command.rb:48:in `invoke'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/railties-7.0.2.4/lib/rails/commands.rb:18:in `<main>'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from bin/rails:18:in `<main>'

```

소스 코드를 빠르게 검색해 보았지만(대부분 Ruby에 익숙하지 않아서), 아직 해결 방법을 찾지 못했습니다. 혹시 아이디어가 있을까요?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [4월 30, 2022, 12:23오후 UTC](https://meta.discourse.org/t/current-hostname-uninitialized-constant/225742/2 "2022-04-30T12:23:58Z")

</div>

launcher를 사용하여 이미지를 빌드하고, 정상 작동을 위해 필요한 환경 변수와 함께 실행하세요. 필요한 환경 변수는 launcher 명령어 중 시작 호출만 표시하는 명령어를 통해 확인할 수 있습니다(구체적인 방법은 launcher 코드를 참고하세요).

라이브 데이터베이스에 대해 빌드한 후 실행하거나, 임시 데이터베이스에 대해 빌드한 후 실행 시점에 마이그레이션 및 에셋 사전 컴파일을 수행하는 방법 중 하나를 선택할 수 있습니다.

이 모든 내용은 여기서 제공하는 지원 범위를 벗어납니다.

또는 bitnami를 사용할 수도 있습니다(이 경우에도 여기서 지원되지 않습니다).

---

<div class="post-metadata">

### Author: ![gdude2002](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gdude2002/32/258537_2.png) [@gdude2002](https://meta.discourse.org/u/gdude2002)
#### Post date: [4월 30, 2022, 3:24오후 UTC](https://meta.discourse.org/t/current-hostname-uninitialized-constant/225742/3 "2022-04-30T15:24:11Z")

</div>

답변 주셔서 감사합니다. 특히 k8s는 여기서는 다소 범위를 벗어난 주제인데도 불구하고 정말 감사드립니다.

인스턴스에 플러그인을 추가해야 하므로 Bitnami를 직접 사용할 수는 없지만, 전반적으로 유용한 추천인 것 같습니다.

모든 것을 세 번씩 확인하고 있으니, 런처에 대한 힌트도 감사합니다. 무사히 진행되길 바랍니다.

---

<div class="post-metadata">

### Author: ![gdude2002](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gdude2002/32/258537_2.png) [@gdude2002](https://meta.discourse.org/u/gdude2002)
#### Post date: [5월 2, 2022, 10:28오후 UTC](https://meta.discourse.org/t/current-hostname-uninitialized-constant/225742/4 "2022-05-02T22:28:18Z")

</div>

실제로 이는 빌드 파일이 아니라 k8s 쪽에서 환경 변수가 누락된 것과 관련된 문제인 것 같습니다. 도움을 주셔서 감사합니다.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [6월 1, 2022, 10:29오후 UTC](https://meta.discourse.org/t/current-hostname-uninitialized-constant/225742/5 "2022-06-01T22:29:06Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
