首页 > 解决方案 > 将 RoR 应用程序部署到 Heroku,出现“Ruby 解释器或扩展库中的错误”错误

问题描述

在上面的图片中是我能找到的所有错误。我更新了 yarn、webpacks、bundler 和 ruby​​。老实说,不知道为什么它不起作用。我过去部署过没有问题。以下是来自 heroku 终端的错误。

remote:        You may have encountered a bug in the Ruby interpreter or extension libraries.
remote:        Bug reports are welcome.
remote:        For details: https://www.ruby-lang.org/bugreport.html
remote:        
remote:        Aborted
remote: 
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...


###### WARNING:
       There is a known bundler bug with your version of Ruby
       
       Your version of Ruby contains a problem with the built-in integration of bundler. If
       you encounter a bundler error you need to upgrade your Ruby version. We suggest you upgrade to:
       
       2.6.6
       
       For more information see:
         https://devcenter.heroku.com/articles/bundler-version#known-upgrade-issues
###### WARNING:
       Removing `Gemfile.lock` because it was generated on Windows.
       Bundler will do a full resolve so native gems are handled properly.
       This may result in unexpected gem versions being used in your app.
       In rare occasions Bundler may not be able to resolve your dependencies at all.
       
       https://devcenter.heroku.com/articles/bundler-windows-gemfile
-----> Installing dependencies using bundler 2.1.4
       Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin bundle install -j4
       Fetching https://github.com/doabit/semantic-ui-sass.git
       The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.


Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       yarn install v1.22.4
       [1/4] Resolving packages...
       [2/4] Fetching packages...
       info fsevents@2.1.3: The platform "linux" is incompatible with this module.
       info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
       info fsevents@1.2.13: The platform "linux" is incompatible with this module.
       info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
       [3/4] Linking dependencies...
       warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has incorrect peer dependency "webpack@^4.0.0".
       [4/4] Building fresh packages...
       Done in 32.34s.
       yarn install v1.22.4
       [1/4] Resolving packages...
       [2/4] Fetching packages...
       info fsevents@2.1.3: The platform "linux" is incompatible with this module.
       info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
       info fsevents@1.2.13: The platform "linux" is incompatible with this module.
       info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
       [3/4] Linking dependencies...
       warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has incorrect peer dependency "webpack@^4.0.0".
       [4/4] Building fresh packages...
       Done in 6.25s.
       /tmp/build_1c2393a0/vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc/engine.rb:43: [BUG] Segmentation fault at 0x0000000000000000
       ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-linux]


我还删除了 gemlock 文件并重新捆绑。我还在使用设计 gem,当我尝试将代码发送到 heroku 时,它似乎停止了。我也在使用 CLI 并尝试了 github 部署。两者都不起作用。

标签: ruby-on-railsherokudeployment

解决方案


所以问题不在于Ruby。这是我使用 AWS s3 存储桶和活动存储的事实。在 Rails 应用程序中使用活动存储时,您需要一个 ruby​​ 构建包和一个活动存储构建包。然后您需要在 AWS 端的 Heroku 上设置存储桶,并且您需要使用特定的规则来设置存储桶。然后你必须将密钥和存储桶名称输入 Heroku。这是s3东西的链接。


推荐阅读