Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require_tree doesn't pull all files in when precompiling #272

Open
Martin288 opened this issue Sep 6, 2015 · 5 comments
Open

require_tree doesn't pull all files in when precompiling #272

Martin288 opened this issue Sep 6, 2015 · 5 comments

Comments

@Martin288
Copy link

Hi guys, recently I meet a weird problem but I can not find any solution. The below shows my assets organization:

--- app
 |--- assets
   |--- stylesheets
     |--- home.css
     |--- home
       |--- file1.css.scss
       |--- file2.css.scss
       |--- file3.css.scss

The below lists the content in my app/assets/stylesheets/home.css:

/*
 * require bootstrap
 * require pickaday
 * require_tree ./home

As the file shown, I need to require two stylesheets under vender directory and require all files under app/assets/stylesheets/home, but when I run RAILS_ENV=staging rake assets:precompile, the precompiled file public/assets/home-xxxxxxxxxxxxxxxx.css only includes codes from bootstrap, pickaday, file2 and file3, which excludes file1. I have tried to delete the precompiled assets and re-run the command, but the same result appeared again.

Is there anything should pay attention to when work with require_tree directive?

@rafaelfranca
Copy link
Member

Is there any chance of file1 be called index?

On Sun, Sep 6, 2015, 04:56 Martin288 notifications@github.com wrote:

Hi guys, recently I meet a weird problem but I can not find any solution.
The below shows my assets organization:

--- app
|--- assets
|--- stylesheets
|--- home.css
|--- home
|--- file1.css.scss
|--- file2.css.scss
|--- file3.css.scss

The below lists the content in my app/assets/stylesheets/home.css:

/* * require bootstrap * require pickaday * require_tree ./home

As the file shown, I need to require two stylesheets under vender
directory and require all files under app/assets/stylesheets/home, but
when I run RAILS_ENV=staging rake assets:precompile, the precompiled file
public/assets/home-xxxxxxxxxxxxxxxx.css only includes codes from bootstrap,
pickaday, file2 and file3, which excludes file1. I have tried to delete
the precompiled assets and re-run the command, but the same result appeared
again.

Is there anything should pay attention to when work with require_tree
directive?


Reply to this email directly or view it on GitHub
#272.

@Martin288
Copy link
Author

@rafaelfranca no, it is named begin_promotion.css.scss.

@Martin288
Copy link
Author

@rafaelfranca additional information here:

If I continue to add new file under app/assets/stylesheets/home/, it seems that it can not detect any changes with new added file, I need to modify an existed file such as file2.css.scss to make assets pipeline to precompile the home.css so that new added file will get a chance to be pulled in. But unfortunately, this behaviour appears randomly.

@Martin288
Copy link
Author

Update again:

Today I tried to deploy the application from another git branch, which doesn't require begin_promotion.css.scss and hence there is no this file in the repo, but when capistrano run rake assets:precompile, it complained that:

Sprockets::FileNotFound: could not find file: /xxxxxxx/releases/20150908075154/app/assets/stylesheets/home/begin_promotion.css.scss

It seems like that Sprockets always try to load files from something cached?

@rafaelfranca
Copy link
Member

Looks like you are having caching problems. Can you please provide a sample application that reproduces the error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants