简体   繁体   中英

rake assets:precompile failing without a useful error

I'm trying to precompile my assets, but whenever I try it fails with an error, but doesn't tell me anything other than that so I have no idea where it's coming from or how to find it. I'm running rake assets:precompile --trace and getting the following output

** Invoke assets:precompile (first_time)
** Execute assets:precompile
/home/nginx/.rvm/rubies/ruby-1.9.3-p327/bin/ruby /home/nginx/.rvm/gems/ruby-1.9.3-p327/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
undefined method `[]' for nil:NilClass
Command failed with status (1): [/home/nginx/.rvm/rubies/ruby-1.9.3-p327/bi...]

That is the full output, I've not cut anything out. As you can see, I'm just getting an error but no location or anything else.

Is there some way I can easily track this down?

OK I figured it out..well sort of. So I know roughly why I was getting the error but still not the actual reason for the error and which file it was :(

But basically, I have altered the files that are precompiled by rails, and the method I was using was causing all css files to be precompiled regardless of whether I was importing the files into application.css.scss or not.

This was then leading to some of the SASS mixins not being found, and for some reason, having the asset compression settings that I have, caused me to simply get the error I originally posted.

Once I'd disabled the compression, I got a more helpful error which eventually lead me to the final solution.

Thanks :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM