Home>

I can't deploy to heroku and it's stuck.

I did a lot of research and tried it myself, but it didn't work and I don't know how to solve it ...

The current situation is as follows.

■ Specs
・ Mac os
・ Rails 6.0.3.4
・ Ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-darwin19]

■ What I tried
-Confirm that i am committed.
-Deleted the heroku app and recreated it.
-Execute the git push heroku branch name: main command in the error message.
→ git push heroku master: main
→ git push heroku develop: main
Both failed to deploy with the same error ...

We apologize for the inconvenience, and thanks for your understanding.

■ Error message (after git push heroku master)

Enumerating objects: 9414, done.
Counting objects: 100% (9414/9414), done.
Delta compression using up to 8 threads
Compressing objects: 100% (8045/8045), done.
Writing objects: 100% (9414/9414), 31.47 MiB | 567.00 KiB/s, done.
Total 9414 (delta 2551), reused 6930 (delta 849), pack-reused 0
remote: Compressing source files ... done.
remote: Building source:
remote: remote:
remote: ----->Node.js app detected
remote: remote:
remote: ----->Creating runtime environment
remote: remote:
remote: NPM_CONFIG_LOGLEVEL = error
remote: USE_YARN_CACHE = true
remote: NODE_ENV = production
remote: NODE_MODULES_CACHE = true
remote: NODE_VERBOSE = false
remote: remote:
remote: ----->Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote: engines.yarn (package.json): unspecified (use default)
remote: remote:
remote: Resolving node version 12.x ...
remote: Downloading and installing node 12.20.0 ...
remote: Using default npm version: 6.14.8
remote: Resolving yarn version 1.22.x ...
remote: Downloading and installing yarn (1.22.10)
remote: Installed yarn 1.22.10
remote: remote:
remote: ----->Installing dependencies
remote: Installing node modules (yarn.lock)
remote: yarn install v1.22.10
remote: [1/4] Resolving packages ...
remote: [2/4] Fetching packages ...
remote: info fsevents @ 2.1.3: The platform "linux" is incompatible with this module.
remote: info "fsevents @ 2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: info [email protected]: The platform "linux" is incompatible with this module.
remote: info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.remote: [3/4] Linking dependencies ...
remote: warning ">[email protected]" has unmet peer dependency "[email protected]^ 4.0.0 || ^ 5.0.0".
remote: warning "webpack-dev-server>[email protected]" has unmet peer dependency "[email protected]^ 4.0.0".
remote: [4/4] Building fresh packages ...
remote: Done in 34.94s.
remote: remote:
remote: ----->Build
remote: remote:
remote: ----->Pruning devDependencies
remote: yarn install v1.22.10
remote: [1/4] Resolving packages ...
remote: [2/4] Fetching packages ...
remote: info fsevents @ 2.1.3: The platform "linux" is incompatible with this module.
remote: info "fsevents @ 2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: info [email protected]: The platform "linux" is incompatible with this module.
remote: info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: [3/4] Linking dependencies ...
remote: warning ">[email protected]" has unmet peer dependency "[email protected]^ 4.0.0 || ^ 5.0.0".
remote: warning "webpack-dev-server>[email protected]" has unmet peer dependency "[email protected]^ 4.0.0".
remote: [4/4] Building fresh packages ...
remote: warning Ignored scripts due to flag.
remote: Done in 6.71s.
remote: remote:
remote: ----->Caching build
remote: --yarn cache
remote: remote:
remote: ----->Build succeeded!
remote:! Unmet dependencies don't fail yarn install but may cause runtime issues
remote: https://github.com/npm/npm/issues/7494
remote: remote:
remote: ----->Ruby app detected
remote: ----->Installing bundler 2.1.4
remote: ----->Removing BUNDLED WITH version in the Gemfile.lock
remote: ----->Compiling Ruby/Rails
remote: ----->Using Ruby version: ruby-2.6.6
remote: ----->Installing dependencies using bundler 2.1.4
remote: Running: BUNDLE_WITHOUT ='development: test' BUNDLE_PATH = vendor/bundle BUNDLE_BIN = vendor/bundle/bin BUNDLE_DEPLOYMENT = 1 bundle install -j4
remote:/tmp/build_7d30a02c/bin/bundle: 34: in `gemfile': undefined method` present?' For "/ tmp/build_7d30a02c/Gemfile": String (NoMethodError)
remote: from/tmp/build_7d30a02c/bin/bundle: 41: in `lockfile'
remote: from/tmp/build_7d30a02c/bin/bundle: 49: in `lockfile_version'
remote: from/tmp/build_7d30a02c/bin/bundle: 58: in `bundler_version'
remote: from/tmp/build_7d30a02c/bin/bundle: 62: in `bundler_requirement'
remote: from/tmp/build_7d30a02c/bin/bundle: 89: in `activate_bundler'
remote: from/tmp/build_7d30a02c/bin/bundle: 78: in `load_bundler!'
remote: from/tmp/build_7d30a02c/bin/bundle: 102: in `<main>'
remote: Bundler Output:/tmp/build_7d30a02c/bin/bundle: 34: in `gemfile': undefined method` present?' For "/ tmp/build_7d30a02c/Gemfile": String (NoMethodError)
remote: from/tmp/build_7d30a02c/bin/bundle: 41: in `lockfile'
remote: from/tmp/build_7d30a02c/bin/bundle: 49: in `lockfile_version'
remote: from/tmp/build_7d30a02c/bin/bundle: 58: in `bundler_version'
remote: from/tmp/build_7d30a02c/bin/bundle: 62: in `bundler_requirement'
remote: from/tmp/build_7d30a02c/bin/bundle: 89: in `activate_bundler'
remote: from/tmp/build_7d30a02c/bin/bundle: 78: in `load_bundler!'
remote: from/tmp/build_7d30a02c/bin/bundle: 102: in `<main>'
remote: remote:
remote:!
remote:! Failed to install gems via Bundler.remote:!
remote:! Push rejected, failed to compile Ruby app.
remote: remote:
remote:! Push failed
remote: Verifying deploy ...
remote: remote:
remote:! Push rejected to music-sns-app.
remote: remote:
To https://git.heroku.com/music-sns-app.git
 ! [remote rejected] heroku_deploy_error->main (pre-receive hook declined)
error: failed to push some refs to'https://git.heroku.com/music-sns-app.git'

■ heroku logs

Build failed --check your build output: URL
source'https://rubygems.org'
git_source (: github) {| repo | "https://github.com/#{repo}.git"}
ruby '2.6.6'
gem'rails','~>6.0.3','>= 6.0.3.3'
gem'bcrypt'
gem'puma','~>4.1'
gem'sass-rails','>= 6'
gem'webpacker','~>4.0'
gem'turbolinks','~>5'
gem'jbuilder','~>2.7'
gem'bootsnap','>= 1.4.2', require: false
gem'bootstrap-sass'
gem'devise'
gem'faker'
gem'jquery-rails'
gem'will_paginate'
gem'bootstrap-will_paginate'
group: development,: test do
  gem "factory_bot_rails"
  gem'rubocop-airbnb'
  gem'rails-controller-testing'
  gem'rspec-rails'
  gem'sqlite3'
  gem'byebug', platforms: [: mri,: mingw,: x64_mingw]
end
group: development do
  gem'spring-commands-rspec'
  gem'web-console','>= 3.3.0'
  gem'listen','~>3.2'
  gem'spring'
  gem'spring-watcher-listen','~>2.0.0'
end
group: test do
  gem'webdrivers'
  gem'capybara','>= 2.15'
  gem'selenium-webdriver'
end
group: production do
  gem'pg'
end
gem'tzinfo-data'
  • Answer # 1

    This case has been resolved!
    It seems that an error occurred in the bin/bundle file, so I fixed it and it was able to deploy successfully.

  • Answer # 2

    https://qiita.com/seiya2130/items/999b5512fa5aa7121784
    I got a similar error in this article, and the poster seems to have solved it, so why not try it as a reference? (Before pushbundle install)