Reputation: 5249
When I run bundle exec rake assets:precompile --trace
, my precompilation fails but I cannot see any specific reason for it.
See this pastebin for my output: http://pastebin.com/zggZyPyM
Upvotes: 5
Views: 3735
Reputation: 438
This issue can also be resolved by using a node.js JS runtime to precompile assets as it apparently has a lower memory footprint. For Ubunutu 14.04 I needed to run apt-get install nodejs
, then replace the default js runtime in the Gemfile
with gem 'node'
, run bundle
and finally rerun the precompile. I would caution against precompiling in another location as you may forget to do this after a css or js change, leading to errors.
Upvotes: 0
Reputation: 71
, but issue was resolvedI tried installing node.js first. And then, ran the following command bundle exec rake assets:precompile
. Only then I didn't notice the error.
Initially, I thought it was because of low memory too. Cleaned almost all running applications, but couldn't find a solution. Plus, I opened Ruby as administrator. Not sure if that helped too, but issue was resolved.
Upvotes: 2
Reputation: 10907
Precompiling assets takes a lot of memory. ~=400mb in my case. It might be possible that OS is killing of the process due to excessive memory usage. You can check the syslog to verify if that is the case.
You can increase the memory of your server to avoid the situation. If that is not possible, I would suggest that you precompile assets on your local system, commit them to the repo and deploy to the server. That way you wouldn't have to compile assets on your server. However you might want to look into ways to delete the previously generated assets somehow and also automate the process.
Upvotes: 13