Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't deploy rails app to Heroku due to a security issue

I tried deploying it multiple times but got the same error. I'm new to ruby on rails and have no idea how to solve it. I tried cloning it locally and changing the file to read "config.assets.compile = false" instead of true. That didn't work either. Any ideas? Here's the link to the git repository I'm trying to download. Let me know if I need to be more specific about anything. Thanks for all the help!

There was an issue building your app. This can mean your app.json's project is not a valid Heroku application. Please ensure your app is deployable to Heroku and try again.

-----> Installing node-v8.10.0-linux-x64
       Detected manifest file, assuming assets were compiled locally
-----> Detecting rails configuration
       sh: 2: config.assets.compile: not found
       !
       ! A security vulnerability has been detected in your application.
       ! To protect your application you must take action. 
         Your application
       ! is currently exposing its credentials via an easy to exploit 
         directory
       ! traversal.
       !
       ! To protect your application you must either upgrade to 
         Sprockets version "3.7.2"
       ! or disable dynamic compilation at runtime by setting:
       !
       ! ! config.assets.compile = false # Disables security 
         vulnerability !
       !
       ! Push rejected, failed to compile Ruby app.
       ! Push failed
like image 369
Alex Avatar asked Jun 19 '18 19:06

Alex


2 Answers

This should work:

bundle update sprockets
like image 179
LanceCE Avatar answered Sep 21 '22 22:09

LanceCE


Alternatively to updating sprockets with bundle update sprockets, you can disable config.assets.compile in config/environments/production.rb.

For more information, Heroku published a very detailed blog post on this subject: https://blog.heroku.com/rails-asset-pipeline-vulnerability

like image 30
Pelle Jacobs Avatar answered Sep 18 '22 22:09

Pelle Jacobs