【问题标题】:Can't deploy rails app to Heroku due to a security issue由于安全问题,无法将 Rails 应用程序部署到 Heroku
【发布时间】:2018-06-21 18:16:02
【问题描述】:

我尝试多次部署它,但都遇到了同样的错误。我是 ruby​​ on rails 的新手,不知道如何解决它。我尝试在本地克隆它并将文件更改为读取“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

【问题讨论】:

    标签: ruby-on-rails heroku


    【解决方案1】:

    这应该有效:

    bundle update sprockets
    

    【讨论】:

    • 它在 @Alex 上工作,就我而言,我在我的控制台而不是 heroku 控制台上运行它
    【解决方案2】:

    除了使用bundle update sprockets 更新链轮之外,您还可以在config/environments/production.rb 中禁用config.assets.compile。

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

    【讨论】:

    • 即使使用 ``` config/environments/production.rb 30,我仍然看到这个:config.assets.compile = false ``
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-03
    • 2021-12-25
    • 1970-01-01
    • 2015-03-09
    • 2014-07-16
    相关资源
    最近更新 更多