1

nginx とパッセンジャーを使用してアプリケーションを実行すると、css や js が 1 つも読み込まれず、次のエラーが表示されます。

cache: [GET /assets/application-403103e41ab40b92f00b841ac9afb23a.js] miss 

    Started GET "/assets/application-403103e41ab40b92f00b841ac9afb23a.js" for localhost at 2013-10-07 10:48:13 +0530    
    ActionController::RoutingError (No route matches [GET] "/assets/application-403103e41ab40b92f00b841ac9afb23a.js"):

    cache: [GET /assets/jquery.blockUI-49c048033e3dfb8cfab8eff7edbdc553.js] miss    

    Started GET "/assets/jquery.blockUI-49c048033e3dfb8cfab8eff7edbdc553.js" for localhost at 2013-10-07 10:48:18 +0530    
    ActionController::RoutingError (No route matches [GET] "/assets/jquery.blockUI-49c048033e3dfb8cfab8eff7edbdc553.js"):

私の config/environments/production.rb で

# Code is not reloaded between requests
  config.cache_classes = true

  # Full error reports are disabled and caching is turned on
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true

  # Disable Rails's static asset server (Apache or nginx will already do this)
  config.serve_static_assets = true

  # Compress JavaScripts and CSS
  config.assets.compress = true

  # Don't fallback to assets pipeline if a precompiled asset is missed
  config.assets.compile = false

  # Generate digests for assets URLs
  config.assets.digest = true

config/application.rb 内

config.assets.precompile << Proc.new do |path|
    if path =~ /\.(css|js)\z/
        full_path = Rails.application.assets.resolve(path).to_path
        app_assets_path = Rails.root.join('app', 'assets').to_path
        if full_path.starts_with? app_assets_path
          puts "including asset: " + full_path
          true
        else
          puts "excluding asset: " + full_path
          false
        end
    else
        false
    end
    end

application.cssアプリの要件であるため、すべてのファイルを個別にコンパイルしましたapplication.js。ファイルにはマニフェストが含まれていません。This files are blank.

助けてください...

4

0 に答える 0