0

5 天后我没有收到 Heroku 支持的任何回复,所以看看 Stackoverflow 上的“非官方支持”是否更好

我在 9 月 24 日成功地使用 Ruby 2.7 将 Build 部署到 Heroku

特别是日志文件将捆绑列为

       Bundled gems are installed into `./vendor/bundle`
       Bundle completed (0.52s)       Cleaning up the bundler cache.
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile

但是,当我现在尝试使用 Ruby 3.0.2 部署相同的应用程序时,我遇到了构建失败。

特别是该错误似乎与捆绑器有关

       Bundled gems are installed into `./vendor/bundle`
       Bundle completed (27.99s)
       Cleaning up the bundler cache.
       Removing bundler (2.2.21)
-----> Detecting rake tasks
 !
 !     Could not detect rake tasks
 !     ensure you can run `$ bundle exec rake -P` against your app
 !     and using the production group of your Gemfile.
 !     /tmp/build_fc71b121/vendor/ruby-3.0.2/lib/ruby/3.0.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'bundler' (= 2.2.21) - did find: [bundler-2.2.22] (Gem::MissingSpecVersionError)
 !     Checked in 'GEM_PATH=/tmp/build_fc71b121/vendor/bundle/ruby/3.0.0' , execute `gem env` for more information
 !     from /tmp/build_fc71b121/vendor/ruby-3.0.2/lib/ruby/3.0.0/rubygems/dependency.rb:323:in `to_spec'
 !     from /tmp/build_fc71b121/vendor/ruby-3.0.2/lib/ruby/3.0.0/rubygems/core_ext/kernel_gem.rb:62:in `gem'
 !     from /tmp/build_fc71b121/bin/spring:9:in `<top (required)>'
 !     from /tmp/build_fc71b121/bin/rake:9:in `load'
 !     from /tmp/build_fc71b121/bin/rake:9:in `<main>'
 !
/tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/helpers/rake_runner.rb:106:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)
ensure you can run `$ bundle exec rake -P` against your app
and using the production group of your Gemfile.
/tmp/build_fc71b121/vendor/ruby-3.0.2/lib/ruby/3.0.0/rubygems/dependency.rb:313:in `to_specs': Could not find 'bundler' (= 2.2.21) - did find: [bundler-2.2.22] (Gem::MissingSpecVersionError)
Checked in 'GEM_PATH=/tmp/build_fc71b121/vendor/bundle/ruby/3.0.0' , execute `gem env` for more information

通过将成功日志与此失败日志进行比较,这些行在失败的部署中对我来说很突出:

   Removing bundler (2.2.21)

然后随后

Could not find 'bundler' (= 2.2.21) - did find: [bundler-2.2.22] (Gem::MissingSpecVersionError)

为什么 Heroku buildpack 会删除它随后抱怨不存在的捆绑程序版本?

我不知道如何解决这个问题,因为我相信 Heroku Ruby buildpack 被锁定到 Bundler 2.2.21。

如果有人对为什么会出现 Bundler 问题有任何想法,我很想知道。谢谢。

4

0 回答 0