由于安全性问题,无法将Rails应用部署到Heroku

时间:2018-06-19 19:17:48

标签: ruby-on-rails heroku

我尝试多次部署它,但是遇到了相同的错误。我是红宝石的新手,也不知道如何解决它。我尝试在本地克隆它,并将文件更改为读取“ config.assets.compile = false”,而不是true。那也不起作用。有任何想法吗?这是我要下载的git存储库的link。让我知道我是否需要更具体地说明任何事情。感谢您的所有帮助!

构建您的应用程序时出现问题。这可能意味着您的app.json项目不是有效的Heroku应用程序。请确保您的应用程序可部署到Heroku,然后重试。

-----> 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

2 个答案:

答案 0 :(得分:13)

这应该有效:

bundle update sprockets

答案 1 :(得分:1)

或者使用bundle update sprockets更新链轮,也可以在config/environments/production.rb中禁用config.assets.compile。

有关更多信息,Heroku发表了关于此主题的非常详细的博客文章:https://blog.heroku.com/rails-asset-pipeline-vulnerability