{"id":6317,"date":"2021-01-18T09:54:58","date_gmt":"2021-01-18T00:54:58","guid":{"rendered":"https:\/\/yumishin.com\/?p=6317"},"modified":"2021-03-30T08:55:31","modified_gmt":"2021-03-29T23:55:31","slug":"heroku-push-error","status":"publish","type":"post","link":"https:\/\/yumishin.com\/?p=6317","title":{"rendered":"Heroku\u3078Push\u3059\u308b\u969b\u306b\u300cFailed to install gems via Bundler.\u300d\u304c\u51fa\u305f\u6642\u306e\u5bfe\u51e6\u6cd5"},"content":{"rendered":"<p>\u3053\u3093\u306a\u3068\u3053\u308d\u3067\u3053\u3093\u306a\u306b\u30cf\u30de\u308b\u3068\u306f\u601d\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u3068\u8a00\u3046\u308f\u3051\u3067\u4eca\u56de\u306fHeroku\u3078Push\u3059\u308b\u969b\u306b\u300cFailed to install gems via Bundler.\u300d\u304c\u51fa\u305f\u6642\u306e\u5bfe\u51e6\u6cd5\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u3066\u304a\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2 id=\"i-0\">Heroku\u3078Push\u3059\u308b\u969b\u306b\u300cFailed to install gems via Bundler.\u300d\u304c\u51fa\u305f\u6642\u306e\u5bfe\u51e6\u6cd5<\/h2>\n<h2 id=\"i-1\">\u7d50\u8ad6<\/h2>\n<p><span style=\"color: #ff0000;\">bundler\u306e\u30d0\u30fc\u30b7\u30e7\u30f3\u30922.2.5\u21922.1.4\u3078\u4e0b\u3052\u305f\u3002<\/span><\/p>\n<p>\u8a00\u3044\u65b9\u3092\u304b\u3048\u308b\u3068Heroku\u74b0\u5883\u306ebundler\u306eversion\u3068\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u306ebundler\u306eversion\u3092\u4e00\u81f4\u3055\u305b\u305f\u3002\u4eca\u56de\u306e\u5834\u5408\u306f\u3001Heroku\u306ebundler\u304c2.1.4\u3060\u3063\u305f\u3051\u3069\u3001\u30ed\u30fc\u30ab\u30eb\u3067\u306f2.2.5\u3060\u3063\u305f\u305f\u3081\u3001Heroku\u306bpush\u3057\u305f\u969b\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3002<\/p>\n<p>\u203bRuby 3.0.0\u3001Rails 6.1.1\u3068\u3044\u3046\u3053\u306e\u5f53\u6642\u306e\u6700\u65b0\u7248\u306eRuby\u3068Rails\u3092\u4f7f\u7528\u3002<\/p>\n<hr class=\"dotted\">\n<p>\u3082\u3057\u4e0a\u8a18\u624b\u6cd5\u3092\u884c\u306a\u3063\u305f\u4e0a\u3067\u3001\u307e\u3060\u89e3\u6c7a\u3057\u306a\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u624b\u9806\u3092\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ol>\n<li>bundle lock \u2013add-platform x86_64-linux \u3092\u5b9f\u884c<\/li>\n<li>Gemfile.lock\u306e\u5909\u66f4\u5185\u5bb9\u3092push\u3002\u5909\u66f4\u3092\u30ea\u30e2\u30fc\u30c8\u306b\u53cd\u6620<\/li>\n<li>git push heroku master\u3092\u5b9f\u884c<\/li>\n<\/ol>\n<p>\u203b\u8a73\u7d30\u306f\u4ee5\u4e0b\u306e\u95a2\u9023\u8a18\u4e8b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><a class=\"linkto table\" href=\"https:\/\/yumishin.com\/?p=6567\"> <span class=\"tbcell tbimg\"><img loading=\"lazy\" decoding=\"async\" width=\"160\" height=\"160\" src=\"https:\/\/yumishin.com\/wp-content\/uploads\/2021\/01\/Atom-2-160x160.jpg\" class=\"attachment-thumb-160 size-thumb-160 wp-post-image\" alt=\"\"><\/span> <span class=\"tbcell tbtext\"> Heroku\u3078Push\u3059\u308b\u969b\u306b\u300cFailed to install gems via Bundler.\u300d\u304c\u51fa\u305f\u6642\u306e\u5bfe\u51e6\u6cd5Part2 <\/span> <\/a><\/p>\n<h2 id=\"i-2\">\u89e3\u6c7a\u624b\u9806<\/h2>\n<h3 id=\"i-3\">\u30a8\u30e9\u30fc\u906d\u9047<\/h3>\n<p>\u307e\u305a\u306f\u624b\u9806\u901a\u308a\u306b\u9032\u3081\u3066\u3044\u3063\u3066\u3001$git push heroku (\u30d6\u30e9\u30f3\u30c1\u540d):master \u3092\u5b9f\u884c\u3057\u305f\u3068\u3053\u308d\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306bFailed to install gems via Bundler.\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3002<\/p>\n<div class=\"pre_tag\"><span><i class=\"fa fa-code\"><\/i> \u30b3\u30fc\u30c9<\/span><\/p>\n<pre><code>Enumerating objects: 106, done.\nCounting objects: 100% (106\/106), done.\nDelta compression using up to 8 threads\nCompressing objects: 100% (87\/87), done.\nWriting objects: 100% (106\/106), 150.68 KiB | 5.79 MiB\/s, done.\nTotal 106 (delta 3), reused 0 (delta 0)\nremote: Compressing source files... done.\nremote: Building source:\nremote:&nbsp;\nremote: -----&gt; Building on the Heroku-20 stack\nremote:&nbsp; ! &nbsp; &nbsp; Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.\nremote: Detected buildpacks: Ruby,Node.js\nremote: See https:\/\/devcenter.heroku.com\/articles\/buildpacks#buildpack-detect-order\nremote: -----&gt; Ruby app detected\nremote: -----&gt; Installing bundler 2.1.4\nremote: -----&gt; Removing BUNDLED WITH version in the Gemfile.lock\nremote: -----&gt; Compiling Ruby\/Rails\nremote: -----&gt; Using Ruby version: ruby-3.0.0\nremote: -----&gt; Installing dependencies using bundler 2.1.4\nremote:&nbsp; &nbsp; &nbsp; &nbsp; Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor\/bundle BUNDLE_BIN=vendor\/bundle\/bin BUNDLE_DEPLOYMENT=1 bundle install -j4\nremote:&nbsp; &nbsp; &nbsp; &nbsp; Your bundle only supports platforms [\"x86_64-darwin-20\"] but your local platform\nremote:&nbsp; &nbsp; &nbsp; &nbsp; is x86_64-linux. Add the current platform to the lockfile with `bundle lock\nremote:&nbsp; &nbsp; &nbsp; &nbsp; --add-platform x86_64-linux` and try again.\nremote:&nbsp; &nbsp; &nbsp; &nbsp; Bundler Output: Your bundle only supports platforms [\"x86_64-darwin-20\"] but your local platform\nremote:&nbsp; &nbsp; &nbsp; &nbsp; is x86_64-linux. Add the current platform to the lockfile with `bundle lock\nremote:&nbsp; &nbsp; &nbsp; &nbsp; --add-platform x86_64-linux` and try again.\nremote:&nbsp;\nremote:&nbsp; !\nremote:&nbsp; ! &nbsp; &nbsp; Failed to install gems via Bundler.\nremote:&nbsp; !\nremote:&nbsp; ! &nbsp; &nbsp; Push rejected, failed to compile Ruby app.\nremote:&nbsp;\nremote:&nbsp; ! &nbsp; &nbsp; Push failed\nremote: Verifying deploy...\nremote:&nbsp;\nremote: ! Push rejected to vast-shelf-00779.\nremote:&nbsp;\nTo https:\/\/git.heroku.com\/vast-shelf-00779.git\n&nbsp;! [remote rejected] master -&gt; master (pre-receive hook declined)\nerror: failed to push some refs to 'https:\/\/git.heroku.com\/vast-shelf-00779.git'<\/code><\/pre>\n<\/div>\n<h3 id=\"i-4\">\u8abf\u3079\u305f\u5bfe\u51e6\u6cd5\u304c\u52b9\u304b\u306a\u3044\u3002<\/h3>\n<p>\u8272\u3005\u8abf\u3079\u305f\u7d50\u679c\u3001\u4ee5\u4e0b\u306e\u5185\u5bb9\u3067\u5bfe\u5fdc\u3067\u304d\u308b\u307f\u305f\u3044\u306a\u611f\u3058\u3060\u3063\u305f\u306e\u3067\u8a66\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3002<\/p>\n<div class=\"pre_tag\"><span><i class=\"fa fa-code\"><\/i> \u30b3\u30fc\u30c9<\/span><\/p>\n<pre><code>$ bundle install --without production\n$ git commit -a -m \"Update gemfile.lock for heroku\"\n$ git push heroku master<\/code><\/pre>\n<\/div>\n<p>\u305d\u308c\u3067\u3082\u540c\u3058\u30a8\u30e9\u30fc\u304b\u3089\u629c\u3051\u51fa\u305b\u306a\u3044\u3002<\/p>\n<p>\u7d50\u5c40database.yml\u3068\u304b\u3044\u3058\u308b\u554f\u984c\u3067\u306f\u306a\u304f\u3001\u3042\u304f\u307e\u3067\u3082bundler\u306e\u554f\u984c\u306a\u306e\u3067\u3001\u305d\u3053\u3092\u89e3\u6d88\u3057\u306a\u304f\u3066\u306f\u3044\u3051\u306a\u3044\u3068\u8a00\u3046\u3053\u3068\u304c\u5f8c\u304b\u3089\u308f\u304b\u3063\u305f\u3002<\/p>\n<h3 id=\"i-5\">\u89e3\u6c7a\u624b\u9806<\/h3>\n<p>\u3088\u304f\u3088\u304f\u30a8\u30e9\u30fc\u3092\u773a\u3081\u3066\u3044\u308b\u3068\u3001Heroku\u3067\u306fbundler\u304c2.1.4\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308b\u3002<\/p>\n<div class=\"pre_tag\"><span><i class=\"fa fa-code\"><\/i> \u30a8\u30e9\u30fc\u30b3\u30fc\u30c9<\/span><\/p>\n<pre><code>\u7701\u7565...\nremote: -----&gt; Ruby app detected\nremote: -----&gt; Installing bundler 2.1.4\nremote: -----&gt; Removing BUNDLED WITH version in the Gemfile.lock\n\u7701\u7565...<\/code><\/pre>\n<\/div>\n<p>\u6211\u8f29\u306e\u30ed\u30fc\u30ab\u30eb\u306ebundler\u306eversion\u306f\u3001bundler -v\u306b\u3066\u8abf\u3079\u305f\u7d50\u679c\u30012.2.5\u3002\u30ed\u30fc\u30ab\u30eb\u306e\u65b9\u304c\u65b0\u3057\u3044\u3002\u3053\u308c\u304b\u3082\u3068\u601d\u3063\u3066\u3001\u4ee5\u4e0b\u306e\u624b\u9806\u3092\u5b9f\u884c\u3002<\/p>\n<ol>\n<li>\u4eca\u306e\u30ed\u30fc\u30ab\u30eb\u306b\u3042\u308bbundler\u3092\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/li>\n<li>Heroku\u306b\u5408\u308f\u305b\u305fbundler\u306eversion\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/li>\n<li>Gemfile.lock\u3092\u4e00\u5ea6\u524a\u9664\u3002<\/li>\n<li>bundle _2.1.4_ install \u2013without production\u3067Gemfile.lock\u3092\u518d\u5ea6\u751f\u6210\u3002<\/li>\n<li>Heroku\u3078Push\u3092\u30c8\u30e9\u30a4<\/li>\n<\/ol>\n<p>\u4ee5\u4e0b\u30b3\u30de\u30f3\u30c9\u3067\u3059\u3002<\/p>\n<div class=\"pre_tag\"><span><i class=\"fa fa-code\"><\/i> \u30b3\u30fc\u30c9<\/span><\/p>\n<pre><code><span style=\"color: #ff0000;\">% gem uninstall bundler #\u30ed\u30fc\u30ab\u30eb\u306ebundler\u3092\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/span>\nGem bundler-2.2.3 cannot be uninstalled because it is a default gem\nSuccessfully uninstalled bundler-2.2.5\n\n<span style=\"color: #ff0000;\">% gem install bundler --version '2.1.4' #\u30c7\u30d7\u30ed\u30a4\u5148\u306eHeroku\u3068\u540c\u3058version\u306ebundler\u3092\u30ed\u30fc\u30ab\u30eb\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/span>\nFetching bundler-2.1.4.gem\nSuccessfully installed bundler-2.1.4\n1 gem installed\n\n<span style=\"color: #ff0000;\">% bundler -v #bundler\u306eversion\u78ba\u8a8d<\/span>\nBundler version 2.2.3 #\u610f\u56f3\u3057\u3066\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u9055\u3046\u3084\u3093\uff01\n\n<span style=\"color: #ff0000;\">% gem list bundler #\u30ed\u30fc\u30ab\u30eb\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308bbundler\u306eversion\u30ea\u30b9\u30c8\u3092\u8868\u793a<\/span>\n*** LOCAL GEMS ***\nbundler (default: 2.2.3, 2.1.4) #version2.1.4\u304c\u3001\u304d\u3061\u3093\u3068\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\n\n<span style=\"color: #ff0000;\">% rm gemfile.lock #Gemfile.lock\u3092\u524a\u9664 \u2192 \u306a\u305c\u306a\u3089\u4ee5\u524d\u306e\u30ed\u30fc\u30ab\u30eb\u306b\u4fdd\u5b58\u3055\u308c\u3066\u305fbundler\u306eversion(2.2.5)\u3067Gemfile.lock\u304c\u4f5c\u3089\u308c\u3066\u3044\u308b\u305f\u3081\u3002\u3053\u308c\u3092bundler\u306eversion2.1.4\u3067\u4f5c\u308a\u66ff\u3048\u308b\u3002<\/span>\n\n<span style=\"color: #ff0000;\">% bundle _2.1.4_ install\u3000#version\u6307\u5b9a\u3057\u3066bundle install<\/span>\n\nThe dependency tzinfo-data (&gt;= 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`.\nFetching gem metadata from https:\/\/rubygems.org\/............\nFetching gem metadata from https:\/\/rubygems.org\/.\nResolving dependencies....\nUsing rake 13.0.3\n\n\u7701\u7565...\n\nBundle complete! 18 Gemfile dependencies, 75 gems now installed.\nGems in the group production were not installed.\nUse `bundle info [gemname]` to see where a bundled gem is installed.\n\n<span style=\"color: #ff0000;\">% git diff #\u3069\u308c\u304f\u3089\u3044\u5dee\u5206\u304c\u3042\u308b\u3093\u3060\u308d\u3046\u3068\u78ba\u8a8d\u3002bundler2.2.5\u30682.1.4\u3067\u306f\u3069\u308c\u3060\u3051\u5185\u5bb9\u304c\u9055\u3046\u306e\u304b\u306a\u3068\u601d\u3063\u305f\u306e\u3067\u3002<\/span>\n\ndiff --git a\/Gemfile.lock b\/Gemfile.lock\nindex 8fcac01..00de18c 100644\n--- a\/Gemfile.lock\n+++ b\/Gemfile.lock\n@@ -99,10 +99,12 @@ GEM\n&nbsp;&nbsp; &nbsp; method_source (1.0.0)\n&nbsp;&nbsp; &nbsp; mimemagic (0.3.5)\n&nbsp;&nbsp; &nbsp; mini_mime (1.0.2)\n+&nbsp; &nbsp; mini_portile2 (2.5.0)\n&nbsp;&nbsp; &nbsp; minitest (5.14.3)\n&nbsp;&nbsp; &nbsp; msgpack (1.3.3)\n&nbsp;&nbsp; &nbsp; nio4r (2.5.4)\n-&nbsp; &nbsp; nokogiri (1.11.1-x86_64-darwin)\n+&nbsp; &nbsp; nokogiri (1.11.1)\n+&nbsp; &nbsp; &nbsp; mini_portile2 (~&gt; 2.5.0)\n&nbsp; &nbsp; &nbsp;  racc (~&gt; 1.4)\n&nbsp;&nbsp; &nbsp; pg (1.2.3)\n&nbsp;&nbsp; &nbsp; public_suffix (4.0.6)\n@@ -200,7 +202,7 @@ GEM\n&nbsp;&nbsp; &nbsp; zeitwerk (2.4.2)\n&nbsp;PLATFORMS\n-&nbsp; x86_64-darwin-20\n+&nbsp; ruby\n&nbsp;DEPENDENCIES\n&nbsp;&nbsp; bootsnap (&gt;= 1.4.4)\n@@ -226,4 +228,4 @@ RUBY VERSION\n&nbsp; &nbsp; ruby 3.0.0p0\n&nbsp;BUNDLED WITH\n- &nbsp; 2.2.5\n+ &nbsp; 2.1.4 <span style=\"color: #ff0000;\"># \u7d50\u69cb\u5dee\u5206\u304c\u3042\u308b\u306a\u3041\u3002<\/span>\n\n<span style=\"color: #ff0000;\">% git add -A\n% git commit -m 'Bundler\u306eversion\u30922.2.5-&gt;2.1.4\u3078\u5909\u66f4'<\/span>\n&nbsp;1 file changed, 5 insertions(+), 3 deletions(-)\n\n<span style=\"color: #ff0000;\">% bundle _2.1.4_ install --without production # \u305d\u3046\u3044\u3048\u3070without production\u3064\u3051\u308b\u306e\u5fd8\u308c\u3066\u305f\u3068\u601d\u3044\u3001\u518d\u5ea6\u5b9f\u884c<\/span>\n\n[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set without 'production'`, and stop using this flag\n\nThe dependency tzinfo-data (&gt;= 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`.\n\n\u7701\u7565...\n\nBundle complete! 18 Gemfile dependencies, 75 gems now installed.\nGems in the group production were not installed.\nUse `bundle info [gemname]` to see where a bundled gem is installed.\n\n<span style=\"color: #ff0000;\">% git push heroku \uff08\u30d6\u30e9\u30f3\u30c1\u540d\uff09:master # Heroku\u3078\u306e\u30c7\u30d7\u30ed\u30a4\u6210\u529f\u3000<\/span><\/code><\/pre>\n<\/div>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3046\u307e\u304f\u3067\u304d\u307e\u3057\u305f\u3002\u3044\u3084\u30fc\u3088\u304b\u3063\u305f\u3002\u82e6\u3057\u304b\u3063\u305f\u3067\u3059\u3002\u3067\u306f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306a\u3068\u3053\u308d\u3067\u3053\u3093\u306a\u306b\u30cf\u30de\u308b\u3068\u306f\u601d\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u3068\u8a00\u3046\u308f\u3051\u3067\u4eca\u56de\u306fHeroku\u3078Push\u3059\u308b\u969b\u306b\u300cFailed to install gems via Bundler.\u300d\u304c\u51fa\u305f\u6642\u306e\u5bfe\u51e6\u6cd5\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u3066\u304a\u304d\u305f\u3044\u3068\u601d\u3044\u307e &#8230; <\/p>\n","protected":false},"author":1,"featured_media":6328,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[272],"tags":[],"class_list":{"0":"post-6317","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-programing","8":"entry"},"_links":{"self":[{"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/posts\/6317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6317"}],"version-history":[{"count":3,"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/posts\/6317\/revisions"}],"predecessor-version":[{"id":6575,"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/posts\/6317\/revisions\/6575"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/media\/6328"}],"wp:attachment":[{"href":"https:\/\/yumishin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}