Asset pipeline DEPRECATION WARNING tsort.rb:226

前端 未结 3 1824
刺人心
刺人心 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 19:39

    The deprecation warning you're getting is most probably caused by another gem that's setting that configuration for you. For me, we're using rails_serve_static_assets and we're using version 0.0.2. To remove the deprecation warning, just update the gem (issue has been fixed in version 0.0.3)

    bundle update rails_serve_static_assets
    
    0 讨论(0)
  • 2021-01-21 19:44

    Open your environments file. (either environments/production.rb, environments/development.rb, environments/test.rb) depending on which environment you are in.

    Change

    config.serve_static_assets
    

    to

    config.serve_static_files
    
    0 讨论(0)
  • 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
    
    0 讨论(0)
提交回复
热议问题