56203
現在、Docker上でruby:2.5.5-slim-
stretchのイメージを使って、既存のRails5アプリの開発環境を構築しているのですが、`rails
c`を実行した所、フリーズしてしまい、ctrl+cすら受け付けません。  
また何度イメージを作り直しても同じ現象が発生し、コンソール上にログなどを吐かずにフリーズするだけなので、エラーの原因も特定出来ずに困っています。

どの様にすればこの問題を解決できるでしょうか？ご回答いただけると助かります。

以下に試した事を書かせていただきます。

「rails フリーズ」などで検索するとspringに関する記事が上がったので`DISABLE_SPRING=1 rails
c`を試してみましたが、同じくフリーズしました。ただしCtrl+Cは受け付けました。  
その際のログは以下の通りです。

```

    DISABLE_SPRING=1 rails c
    
    ^CTraceback (most recent call last):
        36: from bin/rails:9:in `<main>'
        35: from bin/rails:9:in `require'
        34: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands.rb:16:in `<top (required)>'
        33: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/command.rb:44:in `invoke'
        32: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/command/base.rb:63:in `perform'
        31: from /usr/local/bundle/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
        30: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
        29: from /usr/local/bundle/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
        28: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/commands/console/console_command.rb:96:in `perform'
        27: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/command/actions.rb:15:in `require_application_and_environment!'
        26: from /usr/local/bundle/gems/railties-5.1.7/lib/rails/command/actions.rb:15:in `require'
        25: from /home/hoge/config/application.rb:7:in `<top (required)>'
        24: from /usr/local/lib/ruby/site_ruby/2.5.0/bundler.rb:114:in `require'
        23: from /usr/local/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `require'
        22: from /usr/local/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `each'
        21: from /usr/local/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `block in require'
        20: from /usr/local/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `each'
        19: from /usr/local/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:81:in `block (2 levels) in require'
        18: from /usr/local/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:81:in `require'
        17: from /usr/local/bundle/gems/config-1.7.2/lib/config.rb:9:in `<top (required)>'
        16: from /usr/local/bundle/gems/config-1.7.2/lib/config.rb:9:in `require'
        15: from /usr/local/bundle/gems/config-1.7.2/lib/config/validation/schema.rb:1:in `<top (required)>'
        14: from /usr/local/bundle/gems/config-1.7.2/lib/config/validation/schema.rb:1:in `require'
        13: from /usr/local/bundle/gems/dry-validation-0.13.3/lib/dry-validation.rb:1:in `<top (required)>'
        12: from /usr/local/bundle/gems/dry-validation-0.13.3/lib/dry-validation.rb:1:in `require'
        11: from /usr/local/bundle/gems/dry-validation-0.13.3/lib/dry/validation.rb:39:in `<top (required)>'
        10: from /usr/local/bundle/gems/dry-validation-0.13.3/lib/dry/validation.rb:39:in `require'
         9: from /usr/local/bundle/gems/dry-validation-0.13.3/lib/dry/validation/schema.rb:2:in `<top (required)>'
         8: from /usr/local/bundle/gems/dry-validation-0.13.3/lib/dry/validation/schema.rb:2:in `require'
         7: from /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types/constraints.rb:1:in `<top (required)>'
         6: from /usr/local/bundle/gems/dry-types-0.14.1/lib/dry/types/constraints.rb:1:in `require'
         5: from /usr/local/bundle/gems/dry-logic-0.6.1/lib/dry/logic/rule_compiler.rb:3:in `<top (required)>'
         4: from /usr/local/bundle/gems/dry-logic-0.6.1/lib/dry/logic/rule_compiler.rb:3:in `require'
         3: from /usr/local/bundle/gems/dry-logic-0.6.1/lib/dry/logic/rule.rb:4:in `<top (required)>'
         2: from /usr/local/bundle/gems/dry-logic-0.6.1/lib/dry/logic/rule.rb:4:in `require'
         1: from /usr/local/bundle/gems/dry-logic-0.6.1/lib/dry/logic/operations.rb:9:in `<top (required)>'
    /usr/local/bundle/gems/dry-logic-0.6.1/lib/dry/logic/operations.rb:9:in `require': Interrupt
    
```

また`rails c`時のフリーズ状態で`ps aux`を実行した際の出力を書かせていただきます。

```

    root         1  0.0  0.0  52060   188 pts/0    Ssl+ 17:01   0:00 irb
    root         7  0.0  0.0  19948   224 pts/1    Ss   17:01   0:00 /bin/bash
    root        15  0.0  0.0  19952   232 pts/2    Ss   17:02   0:00 /bin/bash
    root        98  0.1  0.4  70268  9516 pts/1    Sl+  17:43   0:00 /usr/local/bin/ruby bin/rails c
    root       101  0.2  0.6 344256 13292 pts/1    Sl   17:43   0:00 spring server | hoge | started 2 mins ago
    root       104 18.2  1.6 420792 34064 ?        Rsl  17:43   0:30 spring app    | hoge | started 2 mins ago | development mode
    root       117 12.6  0.5  71948 11292 pts/2    Rl   17:45   0:06 ruby /usr/local/bundle/gems/spring-2.1.0/bin/spring server --background
    root       119 23.5  0.0  38380   360 pts/2    R+   17:46   0:00 ps aux
    
```
CC BY-SA 4.0
2019-06-27T18:15:07.167
56156
2019-06-28T18:11:57.810
2019-06-28T01:11:32.443
3060
15186
question
ruby-on-rails docker
rails cがフリーズする
すみません、自己解決しました。  
docker-composeが異常に重いのが原因でした。  
お騒がせいたしました。
CC BY-SA 4.0
2019-06-28T18:11:57.810
56203
2019-06-28T18:11:57.810
15186
56156
answer