Thursday, 15 January 2015

ruby on rails - "Command failed with status ()" when precompiling assets -



ruby on rails - "Command failed with status ()" when precompiling assets -

i having similiar problems lot of users when compiling assets on productive box. difference can't hint out of trace solve problem.

rake assets:precompile rails_env=production --trace ** invoke assets:precompile (first_time) ** execute assets:precompile /usr/local/rbenv/versions/1.9.3-p362/bin/ruby /usr/local/rbenv/versions/1.9.3-p362/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 rake aborted! command failed status (): [/usr/local/rbenv/versions/1.9.3-p362/bin/r...] /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/file_utils.rb:53:in `block in create_shell_runner' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/file_utils.rb:45:in `call' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/file_utils.rb:45:in `sh' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/file_utils_ext.rb:39:in `sh' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/file_utils.rb:80:in `ruby' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/file_utils_ext.rb:39:in `ruby' /home/app/application/ruby/1.9.1/gems/actionpack-3.2.12/lib/sprockets/assets.rake:12:in `ruby_rake_task' /home/app/application/ruby/1.9.1/gems/actionpack-3.2.12/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task' /home/app/application/ruby/1.9.1/gems/actionpack-3.2.12/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/task.rb:205:in `call' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/task.rb:205:in `block in execute' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/task.rb:200:in `each' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/task.rb:200:in `execute' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/task.rb:158:in `block in invoke_with_call_chain' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/task.rb:151:in `invoke_with_call_chain' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/task.rb:144:in `invoke' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:116:in `invoke_task' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:94:in `block (2 levels) in top_level' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:94:in `each' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:94:in `block in top_level' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:88:in `top_level' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:66:in `block in run' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:133:in `standard_exception_handling' /usr/local/rbenv/versions/1.9.3-p362/lib/ruby/1.9.1/rake/application.rb:63:in `run' /usr/local/rbenv/versions/1.9.3-p362/bin/rake:32:in `<main>' tasks: top => assets:precompile

there no status code, fail. not create difference if phone call rake straight or via bundle exec.

about environment debian squeeze box global rbenv installation (/usr/local/rbenv can see trace). ruby 1.9.3 2012-12-25 patchlevel 362.

any hints / ideas on this?

i going reply myself because solve more or less. if has additions, don't hesitate write own reply or comment answer/question.

what i've found out far:

if play around assets:precompile e.g compiling primary assets (assets:precompile:primary) or explicitly calling assets:precompile:all might end hint source of problem. in case, ran errno::eacces on both public/ , tmp/. somehow not displayed, create sure user has total rights create/delete files , folders there.

in case, worked because i've shut downwards rails app , precompiled while down. since precompiling allocates lot of memory, did trial , error , got known killed message when rake tries execute asstes:precompile:primary. task killed because of using much memory.

another problem sprockets not find bootstrap set assets pipeline on precompilation. moving gem 'bootstrap' outside of group :assets solved this. got hinted when played around commands.

the best way solve – or better: work around – problem compile assets locally. throw rake assets:precompile rails_env=development terminal , deploy public/assets. remember delete folder in development environment after deploying or end debugging on why changes on app/assets/* not taking effect in development. @ to the lowest degree works me(tm).

alternatively, growing swap partition may work. however, compilation on vps need utilize swap may take while, i'd stick local way.

ruby-on-rails ruby-on-rails-3 rake asset-pipeline

No comments:

Post a Comment