Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6995273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:00:03+00:00 2026-05-27T20:00:03+00:00

I have that sneaking feeling I’m missing something obvious: I ran RAILS_ENV=production bundle exec

  • 0

I have that sneaking feeling I’m missing something obvious:

I ran

RAILS_ENV=production bundle exec rake assets:precompile

to precompile my assets before pushing to Heroku. Looking in /public/assets shows that application.js and application.css manifests successfully compiled, but none of my standalone files precompiled:

admin.js.coffee
blog.js.coffee.erb
[ ... several more similarly named ... ]
twitter.js.coffee.erb

and

admin.css.less
home.css.less
public.css.less

are all missing from /public/assets.

I thought that Rails would precompile the application.js/.css files, plus anything else that doesn’t end in js/css:

The default matcher for compiling files includes application.js,
application.css and all files that do not end in js or css:

[ /\w+\.(?!js|css).+/, /application.(css|js)$/ ]

from: http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets

I don’t want to have to manually update config.assets.precompile every time an asset file name changes. Am I missing something that will make Rails precompile these assets?

Update

Based on @Richard Hulse’s answer below, I tested it out by created a separate manifest file for a standalone asset (i.e. I renamed twitter.js.coffee.erb to twitter-include.js.coffee.erb and added twitter.js with a single //= require pulling in the renamed original). This seems to work.

There must be a cleaner way than this, and it seems to contradict the Rails guide quoted above. The guide says the only files that won’t be compiled are .js or .css files not named application. What I’m see is only .js or .css being directly compiled (i.e. not via a manifest) – nothing else.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:00:04+00:00Added an answer on May 27, 2026 at 8:00 pm

    Two things:

    If these files are included in your application manifests, then they are included in the site’s application files.

    There should be a line in both application manifests: require_tree, that will pick up all the assets automatically for your. Is that in these files?

    Edit in reply to edit:

    The way I would structure this is have two sets of manifests. The standard ones (application.css/.js) are for public. The admin set are for admin pages. Include all the stuff you want in admin.js/.css manifests and add those files to the precompile array:

    config.assets.precompile += ['admin.js', 'admin.css']
    

    This would allow you to share code between the two groups. For example you can include jquery in both, but jquery_ujs in admin only. In your admin section layout just include the admin manifests instead of the application manifests.

    In practice you will then add new files to the application or admin manifests as you develop the site, and you won’t have to change the precompile configuration.

    Once you get to the point of adding lots of assets, an admin section and so on, it is expected that things will get more complex and that you have to be explicit about what is included in manifests and the order (as opposed to require_tree).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

somehow I have the feeling that I miss the forest for the trees. I
So lets say I have a table that looks something like this: ItemName ProductType
I have often wondered why it is that non-English speaking programmers are forced to
I have an Electronic Workforce (EWF) application that records the caller speaking. The system
I have that page , in FF it's fine, and in ff PC too,
What does Pro have that's not in Standard (or vice-versa)? I need Visual Studio
How can I have that functionality in my game through which the players can
If I have that constraint on a table, (field1 is null and field2 is
I know I have that my connection to the database works, and a test
I would like to have that the height of a canvas change automatically. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.