Asset pipeline DEPRECATION WARNING tsort.rb:226

前端 未结 3 1864
刺人心
刺人心 2021-01-21 19:30

I have rails 4.2 working fine on development but in production env I have the following warning:

DEPRECATION WARNING: The configuration option `con

3条回答
  •  灰色年华
    2021-01-21 20:01

    I have faced the same issue and it seems a warning and not an error, and railties update automatically the serve_static_assets to serve_static_files as per the configuration file.

    Path:
    railties-4.2.7\lib\rails\application\configuration.rb

    Source code snippet:

      # :nodoc:
      SERVE_STATIC_ASSETS_DEPRECATION_MESSAGE = <<-MSG.squish
        The configuration option `config.serve_static_assets` has been renamed
        to `config.serve_static_files` to clarify its role (it merely enables
        serving everything in the `public` folder and is unrelated to the asset
        pipeline). The `serve_static_assets` alias will be removed in Rails 5.0.
        Please migrate your configuration files accordingly.
      MSG
    
      def serve_static_assets
        ActiveSupport::Deprecation.warn SERVE_STATIC_ASSETS_DEPRECATION_MESSAGE
        serve_static_files
      end
    
      def serve_static_assets=(value)
        ActiveSupport::Deprecation.warn SERVE_STATIC_ASSETS_DEPRECATION_MESSAGE
        self.serve_static_files = value
      end
    

提交回复
热议问题