41215


Rails5/pumaを使用しており、検証環境から本番環境へ、環境を移行させようとしています。  
下記の通り、アセットのプリコンパイル及びサーバ起動を行いましたが、レイアウトが崩れました。  
解決方法を教えていただきたく、質問させていただきます。

◆ コマンド

[code]

    $ rails assets:precompile RAILS_ENV=production
    $ rails c
      Running via Spring preloader in process 29262
      Loading development environment (Rails 5.1.4)
      irb(main):001:0> Rails.application.config.assets.prefix
       => "/assets"
    $ sudo [プロジェクト名]/.rbenv/shims/pumactl start RAILS_ENV=production
    
[/code]

◆ ブラウザアクセス  
[https://[ドメイン名]/assets/typeaheadjs.self-027337105ed5038b2f54f30159dab8ca30455083b1e0e02b1571387488b874ea.css](https://\[%E3%83%89%E3%83%A1%E3%82%A4%E3%83%B3%E5%90%8D\]/assets/typeaheadjs.self-027337105ed5038b2f54f30159dab8ca30455083b1e0e02b1571387488b874ea.css)

◆ エラーログ（ブラウザ）

[code]

    Puma caught this error: undefined method `silence' for #<Logger:0x007f1e61f587b0> (NoMethodError)
    [プロジェクト名]/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:11:in `call'
    [プロジェクト名]/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
    [プロジェクト名]/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/request_id.rb:25:in `call'
    [プロジェクト名]/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/method_override.rb:22:in `call'
    [プロジェクト名]/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/runtime.rb:22:in `call'
    [プロジェクト名]/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
    [プロジェクト名]/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/executor.rb:12:in `call'
    [プロジェクト名]/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/static.rb:125:in `call'
    [プロジェクト名]/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/sendfile.rb:111:in `call'
    [プロジェクト名]/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:522:in `call'
    [プロジェクト名]/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.11.0/lib/puma/configuration.rb:225:in `call'
    [プロジェクト名]/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.11.0/lib/puma/server.rb:624:in `handle_request'
    [プロジェクト名]/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.11.0/lib/puma/server.rb:438:in `process_client'
    [プロジェクト名]/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.11.0/lib/puma/server.rb:302:in `block in run'
    [プロジェクト名]/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/puma-3.11.0/lib/puma/thread_pool.rb:120:in `block in spawn_thread'
    
[/code]


CC BY-SA 3.0
2018-01-25T18:59:29.633
41214
2018-01-25T23:47:23.717
2018-01-25T19:03:44.077
2376
25428
question
ruby-on-rails
本番環境でレイアウトが崩れる（CSSが機能しない）


sudo [プロジェクト名] RAILS_ENV=production ./rbenv/shims/pumactl start  
RAILS_ENV=productionをpumactlの前においてはどうですか？


CC BY-SA 3.0
2018-01-25T23:47:23.717
41215
2018-01-25T23:47:23.717
14412
41214
answer