Rails precompiling assets

I’m on a 7 day trial of Render trying to deploy a Rails app. What is the preferred way to compile assets with webpacker? My app won’t load and I get this in the error logs:

ActionView::Template::Error (Webpacker can't find application in /opt/render/project/src/public/packs/manifest.json. Possible causes:
Apr 14 07:58:52 AM  1. You want to set webpacker.yml value of compile to true for your environment
Apr 14 07:58:52 AM     unless you are using the `webpack -w` or the webpack-dev-server.
Apr 14 07:58:52 AM  2. webpack has not yet re-run to reflect updates.
Apr 14 07:58:52 AM  3. You have misconfigured Webpacker's config/webpacker.yml file.
Apr 14 07:58:52 AM  4. Your webpack configuration is not creating a manifest.
Apr 14 07:58:52 AM  Your manifest contains:

So I’m assuming it’s webpacker related.

Hi @trav ,

Have you taken a look at our GitHub - render-examples/rails-6 example app? It has a config/webpacker.yml file that shows how you can configure webpacker.

Hey thanks for the quick response! I’ve looked that over, to me it dosen’t seem any different than the standard boilerplate webpacker.yml file that comes with any Rails project- it is no different from mine.

Hey @trav - Just another Render first time deployer/explorer here myself.

Did you precompile the assets as part of the deployment? If you’re running with RAILS_ENV=production then webpacker by default assumes the assets are precompiled (rails-6/webpacker.yml at master · render-examples/rails-6 · GitHub) which is why there’s nothing your pack path.

1 Like