Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I set up webpacker for production environment?

Dev asked in Rails

Im running my project first on my local machine using Production environment before deploying to production to make sure all is running fine.
im using docker with Rails version 5.2 and webpacker version 5.4.

I cleared the public/assets and public/packs directory then executed the command "RAILS_ENV=production bundle exec rake assets:precompile", it was able to generate and compile the assets however when viewed on the browser, the app returns this errors on the console and the page is broken and not rendering properly.

Sample errors from console:

GET http:// w.local/assets/activestorage.self-1ed4604ac2170045f1ffca4edb81a75246661555e4f9cf682bb8a21825e32e1c.js?body=1 net::ERR_ABORTED 500 (Internal Server Error)

GET http:// w.local/packs/js/modal-5ec40e25a92d9c39b790.js net::ERR_ABORTED 500 (Internal Server Error)

Any suggestion is highly appreciated.
Thank you.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,563+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.