为了保护您的应用程序,您必须升级到Sprockets版本“3。heroku rails error

时间:2018-07-04 13:49:10

标签: ruby-on-rails heroku

部署到heroku时出现错误:

security vulnerability has been detected in your application.
remote:  !     To protect your application you must take action. Your application
remote:  !     is currently exposing its credentials via an easy to exploit directory
remote:  !     traversal.
remote:  !     
remote:  !     To protect your application you must either upgrade to Sprockets version "3.

我试图在控制台中编写捆绑包更新链轮,但出现错误:

An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3' --source 'https://rubygems.org/'` succeeds
before bundling.

我尝试安装

gem install json -v '1.8.3' --source 'https://rubygems.org/'

但是出现错误:

Building native extensions.  This could take a while...
ERROR:  Error installing json:
        ERROR: Failed to build gem native extension.

    current directory: /usr/local/rvm/gems/ruby-2.4.0/gems/json-1.8.3/ext/json/ext/generator
/usr/local/rvm/rubies/ruby-2.4.0/bin/ruby -r ./siteconf20180704-2814-12i6evl.rb extconf.rb
creating Makefile

current directory: /usr/local/rvm/gems/ruby-2.4.0/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /usr/local/rvm/gems/ruby-2.4.0/gems/json-1.8.3/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
generator.c: In function ‘generate_json’:
generator.c:861:25: error: ‘rb_cFixnum’ undeclared (first use in this function)
     } else if (klass == rb_cFixnum) {
                         ^
generator.c:861:25: note: each undeclared identifier is reported only once for each function it appears in
generator.c:863:25: error: ‘rb_cBignum’ undeclared (first use in this function)
     } else if (klass == rb_cBignum) {
                         ^
generator.c: At top level:
cc1: warning: unrecognized command line option "-Wno-self-assign" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-constant-logical-operand" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-parentheses-equality" [enabled by default]
cc1: warning: unrecognized command line option "-Wno-tautological-compare" [enabled by default]
make: *** [generator.o] Error 1

make failed, exit code 2

我还尝试设置envoronments/production.rb config.assets.compile = false,但仍然是相同的错误-无法推送至heroku

1 个答案:

答案 0 :(得分:1)

这是一个临时解决方案:

使用命令heroku/rubyhttps://github.com/heroku/heroku-buildpack-ruby#v186更改为heroku buildpacks

您应该重新获得部署能力和修复该问题的窗口。

source