code-qualityentrepreneurial

How to solve Deployment Failure-`assets:precompile`

I was trying to deploy rails 6 app on ec2 server using capistrano when precompile failure lead to whole deploymentt failure. I had to uninstall cmdtest and install yarn

railsyarn
How to solve Deployment Failure-`assets:precompile`

Issue: Deployment Failure: assets:precompile

 deploy:assets:precompile
      01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
      01 Usage: yarn [options]
      01
      01 yarn: error: no such option: --no-progress

I was trying to deploy rails 6 app on ec2 server using capistrano when precompile failure lead to whole deploymentt failure. I was facing this issue only in server so I started digging what I was doing different on server.

Turns out, On server my yarn command came from cmdtest. So I uninstalled cmdtest and installed yarn.The steps I followed is as below.

Configure the repository:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

Install Yarn:

sudo apt update && sudo apt install yarn

Then I ran the cap:production:deploy and it worked.

Did you also face similar issue while deploying rails apps to ubuntu with webpack enabled? Did this help? Please let me know your findings in the comment section below.

About the author

Prakash Poudel Sharma

Engineering Manager · Product Owner · Varicon

Engineering Manager at Varicon, leading the Onboarding squad as Product Owner. Eleven years of building software — first as a programmer, then as a founder, now sharpening the product craft from the inside of a focused team.

Keep reading

More on this

Join the conversation0 comments

What did you take away?

Thoughts, pushback, or a story of your own? Drop a reply below — I read every one.

Comments are powered by Disqus. By posting you agree to theirterms.

0:000:00