0

我似乎无法正确配置我的 rails 应用程序。我在 Heroku 上部署了一个完美运行的 rails 应用程序。我添加了 datadog buildpack,然后开始出现以下构建错误:

remote:  !     You must use Bundler 2 or greater with this lockfile.

删除我的 Gemfile.lock 并重新安装并确保 bunder 版本大于 2.0 后,我开始收到另一个构建错误。这次是我的项目需要的 bundler 版本 < 2:

remote:        Bundler Output: Activating bundler (< 2) failed:
remote:        Could not find 'bundler' (1.17.3) required by your /tmp/build_3b256cc6024c5dcfd1bd0d030688678a/Gemfile.lock.
remote:        To update to the lastest version installed on your system, run `bundle update --bundler`.
remote:        To install the missing version, run `gem install bundler:1.17.3`
remote:        Checked in 'GEM_PATH=vendor/bundle/ruby/2.5.0', execute `gem env` for more information
remote:        
remote:        To install the version of bundler this project requires, run `gem install bundler -v '< 2'`
remote: 
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...


我不确定如何继续调试此错误。我不知道如何访问 /tmp/build 文件夹,我不确定如果我这样做了我会做什么。

请任何方向或建议将不胜感激。

我已经尝试使用各种版本的 bundler 推送到 heroku master。构建总是有问题。我觉得在构建和实际项目中需要捆绑器的多个区域,并且它们需要不同的版本,但我不知道如何找到它们。

这是我的 Gemfile:

git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.5.1'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.1'
# Use sqlite3 as the database for Active Record
gem 'pg'
gem 'ffi', '~> 1.0.9'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
# gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
gem 'active_model_serializers'

# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Reduces boot times through caching; required in config/boot.rb

# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
gem 'rack-cors'

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  gem 'sqlite3', '~> 1.3.6'
end

group :development do
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
  gem 'nokogiri', '~> 1.6', '>= 1.6.7'
end


# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem "aws-sdk-s3", require: false

这是我的 Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (5.2.2)
      actionpack (= 5.2.2)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
    actionmailer (5.2.2)
      actionpack (= 5.2.2)
      actionview (= 5.2.2)
      activejob (= 5.2.2)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (5.2.2)
      actionview (= 5.2.2)
      activesupport (= 5.2.2)
      rack (~> 2.0)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (5.2.2)
      activesupport (= 5.2.2)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.3)
    active_model_serializers (0.10.9)
      actionpack (>= 4.1, < 6)
      activemodel (>= 4.1, < 6)
      case_transform (>= 0.2)
      jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
    activejob (5.2.2)
      activesupport (= 5.2.2)
      globalid (>= 0.3.6)
    activemodel (5.2.2)
      activesupport (= 5.2.2)
    activerecord (5.2.2)
      activemodel (= 5.2.2)
      activesupport (= 5.2.2)
      arel (>= 9.0)
    activestorage (5.2.2)
      actionpack (= 5.2.2)
      activerecord (= 5.2.2)
      marcel (~> 0.3.1)
    activesupport (5.2.2)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 0.7, < 2)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    arel (9.0.0)
    aws-eventstream (1.0.1)
    aws-partitions (1.139.0)
    aws-sdk-core (3.46.1)
      aws-eventstream (~> 1.0)
      aws-partitions (~> 1.0)
      aws-sigv4 (~> 1.0)
      jmespath (~> 1.0)
    aws-sdk-kms (1.13.0)
      aws-sdk-core (~> 3, >= 3.39.0)
      aws-sigv4 (~> 1.0)
    aws-sdk-s3 (1.30.1)
      aws-sdk-core (~> 3, >= 3.39.0)
      aws-sdk-kms (~> 1)
      aws-sigv4 (~> 1.0)
    aws-sigv4 (1.0.3)
    builder (3.2.3)
    byebug (11.0.0)
    case_transform (0.2)
      activesupport
    concurrent-ruby (1.1.4)
    crass (1.0.4)
    erubi (1.8.0)
    ffi (1.0.11)
    globalid (0.4.2)
      activesupport (>= 4.2.0)
    i18n (1.5.3)
      concurrent-ruby (~> 1.0)
    jmespath (1.4.0)
    jsonapi-renderer (0.2.0)
    listen (3.1.5)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
      ruby_dep (~> 1.2)
    loofah (2.2.3)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    marcel (0.3.3)
      mimemagic (~> 0.3.2)
    method_source (0.9.2)
    mimemagic (0.3.3)
    mini_mime (1.0.1)
    mini_portile2 (2.4.0)
    minitest (5.11.3)
    nio4r (2.3.1)
    nokogiri (1.10.1)
      mini_portile2 (~> 2.4.0)
    pg (1.1.4)
    puma (3.12.0)
    rack (2.0.6)
    rack-cors (1.0.2)
    rack-test (1.1.0)
      rack (>= 1.0, < 3)
    rails (5.2.2)
      actioncable (= 5.2.2)
      actionmailer (= 5.2.2)
      actionpack (= 5.2.2)
      actionview (= 5.2.2)
      activejob (= 5.2.2)
      activemodel (= 5.2.2)
      activerecord (= 5.2.2)
      activestorage (= 5.2.2)
      activesupport (= 5.2.2)
      bundler (>= 1.3.0)
      railties (= 5.2.2)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.0.4)
      loofah (~> 2.2, >= 2.2.2)
    railties (5.2.2)
      actionpack (= 5.2.2)
      activesupport (= 5.2.2)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.19.0, < 2.0)
    rake (12.3.2)
    rb-fsevent (0.10.3)
    rb-inotify (0.10.0)
      ffi (~> 1.0)
    ruby_dep (1.5.0)
    spring (2.0.2)
      activesupport (>= 4.2)
    spring-watcher-listen (2.0.1)
      listen (>= 2.7, < 4.0)
      spring (>= 1.2, < 3.0)
    sprockets (3.7.2)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.2.1)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    sqlite3 (1.3.13)
    thor (0.20.3)
    thread_safe (0.3.6)
    tzinfo (1.2.5)
      thread_safe (~> 0.1)
    websocket-driver (0.7.0)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.3)

PLATFORMS
  ruby

DEPENDENCIES
  active_model_serializers
  aws-sdk-s3
  byebug
  ffi (~> 1.0.9)
  listen (>= 3.0.5, < 3.2)
  nokogiri (~> 1.6, >= 1.6.7)
  pg
  puma (~> 3.11)
  rack-cors
  rails (~> 5.2.1)
  spring
  spring-watcher-listen (~> 2.0.0)
  sqlite3 (~> 1.3.6)
  tzinfo-data

RUBY VERSION
   ruby 2.5.1p57

BUNDLED WITH
   2.0.1

我希望能够在我的代码中找到需要不同版本捆绑器的区域。或者能够用不同的宝石规避这个问题。如果有人可以帮助我让 Heroku 构建工作,我将非常感激。

4

0 回答 0