Sprockets::Rails::Helper::AssetNotPrecompiled Ruby / Rails Origin: Application & API OSI layer 7 · Application Last updated 5 Nov 2026

Rails: Asset `application.js` was not declared to be precompiled in production / The asset "application.css" is not present in the asset pipeline

A layout references an asset that Sprockets doesn't know to compile or can't find.

Exact message you may see Asset `application.js` was not declared to be precompiled in productionThe asset "application.css" is not present in the asset pipelineSprockets::Rails::Helper::AssetNotFound: The asset "x.png" is not present in the asset pipelineActionView::Template::Error (The asset "application.css" is not present in the asset pipeline)
Seen on: Ruby

Meaning

Add the file to app/assets/config/manifest.js (//= link application.js), check the file name/extension, run bin/rails assets:precompile, and in production make sure public/assets exists (or assets are served by the web server). config.assets.compile = false in production requires precompiled assets.

Common causes

  • Asset not linked in manifest.js (Sprockets 4)
  • File missing or renamed
  • Assets not precompiled during deploy
  • javascript_include_tag for a pack built elsewhere
  • Digest/manifest cache stale

⚡ Quick fix

  1. Add //= link_tree ../images and //= link application.css to app/assets/config/manifest.js
  2. RAILS_ENV=production bin/rails assets:precompile
  3. Verify public/assets/.sprockets-manifest*.json

Detailed fix by platform

Rails

  1. bin/rails assets:clobber assets:precompile

How to diagnose

  1. manifest — Linked?
  2. Precompile — Run in deploy?
  3. File — Exists?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

ActiveRecord::AssociationTypeMismatch — Rails: ActiveRecord::AssociationTypeMismatch: User(#1234) expected, got "42" which is an instance of String(#5678) (Ruby / Rails)ActiveRecord::Associa…ActiveRecord::ConnectionNotEstablished — Rails: ActiveRecord::ConnectionNotEstablished: No connection pool for 'ActiveRecord::Base' found (Ruby / Rails)ActiveRecord::Connect…ActiveRecord::Deadlocked: PG::TRDeadlockDetected — Rails: ActiveRecord::Deadlocked: PG::TRDeadlockDetected: ERROR: deadlock detected (Ruby / Rails)ActiveRecord::Deadloc…ActiveRecord::IrreversibleMigration — Rails: ActiveRecord::IrreversibleMigration — This migration uses remove_column without a type; db:rollback can't reverse it (Ruby / Rails)ActiveRecord::Irrever…Missing encryption key to decrypt file with — Rails: ArgumentError: Missing encryption key to decrypt file with. Ask your team for your master key and write it to config/master.key or put it in the ENV['RAILS_MASTER_KEY'] (Ruby / Rails)Missing encryption ke…Missing secret_key_base for 'production' environment — Rails: ArgumentError: Missing `secret_key_base` for 'production' environment, set this string with `bin/rails credentials:edit` (Ruby / Rails)Missing secret_key_ba…Vite manifest not found — Laravel: Vite manifest not found at: public/build/manifest.json (PHP)Vite manifest not fou…Yarn executable was not detected in the system — Rails: Yarn executable was not detected in the system. Download Yarn at https://yarnpkg.com/en/docs/install (Ruby / Rails)Yarn executable was n…Sprockets…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.