Masahiro Okubo

GEM::REQUIREMENT::BADREQUIREMENTERROR DURING HEROKU DEPLOY

GEM::REQUIREMENT::BADREQUIREMENTERROR DURING HEROKU DEPLOY
     
       https://devcenter.heroku.com/articles/bundler-windows-gemfile
-----> Installing dependencies using bundler 2.2.11
       Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin bundle install -j4
       /tmp/build_06703c12/vendor/ruby-2.7.2/lib/ruby/2.7.0/rubygems/requirement.rb:108:in `parse': Illformed requirement ["\\#{Gem::Requirement.default}.a"] (Gem::Requirement::BadRequirementError)
       	from /tmp/build_06703c12/vendor/ruby-2.7.2/lib/ruby/2.7.0/rubygems/requirement.rb:140:in `block in initialize'
       	from /tmp/build_06703c12/vendor/ruby-2.7.2/lib/ruby/2.7.0/rubygems/requirement.rb:140:in `map!'
       	from /tmp/build_06703c12/vendor/ruby-2.7.2/lib/ruby/2.7.0/rubygems/requirement.rb:140:in `initialize'
       	from /tmp/build_06703c12/bin/bundle:97:in `new'
       	from /tmp/build_06703c12/bin/bundle:97:in `activate_bundler'
       	from /tmp/build_06703c12/bin/bundle:86:in `load_bundler!'
       	from /tmp/build_06703c12/bin/bundle:110:in `<main>'
       Bundler Output: /tmp/build_06703c12/vendor/ruby-2.7.2/lib/ruby/2.7.0/rubygems/requirement.rb:108:in `parse': Illformed requirement ["\\#{Gem::Requirement.default}.a"] (Gem::Requirement::BadRequirementError)
       	from /tmp/build_06703c12/vendor/ruby-2.7.2/lib/ruby/2.7.0/rubygems/requirement.rb:140:in `block in initialize'
       	from /tmp/build_06703c12/vendor/ruby-2.7.2/lib/ruby/2.7.0/rubygems/requirement.rb:140:in `map!'
       	from /tmp/build_06703c12/vendor/ruby-2.7.2/lib/ruby/2.7.0/rubygems/requirement.rb:140:in `initialize'
       	from /tmp/build_06703c12/bin/bundle:97:in `new'
       	from /tmp/build_06703c12/bin/bundle:97:in `activate_bundler'
       	from /tmp/build_06703c12/bin/bundle:86:in `load_bundler!'
       	from /tmp/build_06703c12/bin/bundle:110:in `<main>'
 !
 !     Failed to install gems via Bundler.
 !
 !     Push rejected, failed to compile Ruby app.
 !     Push failed

やったこと

# vendor/bundleに色々入っちゃってたので、とりあえず削除
vim .bundle/config

---
BUNDLE_WITHOUT: "production"
~
~
~
~
~
~

wq

rm -rf vendor/bundle

bundle _2.2.5_ install
bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java


gem update --system

これやっても同じエラー発生。。。。。

で、結論の解決策は

rails6.03系でrails new したbin/ の中身をそのまま6.1系のbin/ フォルダに上書きすればOKでした!!

どうやら問題としてはGemのバージョンとか合わない的なエラーで、調べるとbinとかspringとか諸々関わってそうで、入れ替えたらいけます

誰かの助けになればと思ってますので、参考にしてみてください

参考記事

GEM::REQUIREMENT::BADREQUIREMENTERROR DURING HEROKU DEPLOY

class Gem::Requirement::BadRequirementError

Buy Me A Coffee

関連記事

copyright© 2016-2021 Masahiro Okubo