Heroku push rejected because gem checksum failed - ruby-on-rails

I've been pushing updates to my app successfully all week. This morning I went to push another update (just some CSS changes) and suddenly I'm my pushes are being rejected because the checksums on numerous gems seem to be randomly failing. I say randomly because each time I've tried pushing, the failing checksums are for different gems.
I'm not sure if this is a problem with Bundler, RubyGems, or Heroku, but those all seem like obvious candidates. I can't find any mention of similar issues and Heroku seems to have eliminated the ability to submit a support ticket unless you pay for an enterprise support plan.
Any help is greatly appreciated!
Here is the log from the last attempt:
$ git push heroku master
Counting objects: 12, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 1.55 KiB | 1.55 MiB/s, done.
Total 12 (delta 10), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> nginx-buildpack app detected
remote: -----> nginx-buildpack: Installed nginx/1.5.7 to app/bin
remote: -----> nginx-buildpack: Added start-nginx to app/bin
remote: -----> nginx-buildpack: Default mime.types copied to app/config/
remote: -----> nginx-buildpack: Default config copied to app/config.
remote: -----> Image-Optim Buildback app detected
remote: -----> Adding Item-Optim binaries
remote: cp: omitting directory ‘jpegoptim’
remote: ‘advpng’ -> ‘/tmp/build_c96d18fd0f8c4e48e3ec30ced800682d/vendor/image-optim/advpng’
remote: ‘gifsicle’ -> ‘/tmp/build_c96d18fd0f8c4e48e3ec30ced800682d/vendor/image-optim/gifsicle’
remote: ‘jpegtran’ -> ‘/tmp/build_c96d18fd0f8c4e48e3ec30ced800682d/vendor/image-optim/jpegtran’
remote: ‘optipng’ -> ‘/tmp/build_c96d18fd0f8c4e48e3ec30ced800682d/vendor/image-optim/optipng’
remote: ‘pngcrush’ -> ‘/tmp/build_c96d18fd0f8c4e48e3ec30ced800682d/vendor/image-optim/pngcrush’
remote: ‘jpegoptim/jpegoptim-cedar14’ -> ‘/tmp/build_c96d18fd0f8c4e48e3ec30ced800682d/vendor/image-optim/jpegoptim’
remote: -----> Adding image-optim binaries symlink to make them available in next buildpacks
remote: -----> Adding image-optim binaries to PATH
remote: ‘image-optim.sh’ -> ‘/tmp/build_c96d18fd0f8c4e48e3ec30ced800682d/.profile.d/image-optim.sh’
remote: -----> Gemfile detected, adding image-optim config file
remote: ‘image_optim.yml’ -> ‘/tmp/build_c96d18fd0f8c4e48e3ec30ced800682d/.image_optim.yml’
remote: -----> Image-Optim binaries version
remote: advancecomp v1.18 by Andrea Mazzoleni
remote: LCDF Gifsicle 1.78
remote: jpegoptim v1.4.2 x86_64-unknown-linux-gnu
remote: libjpeg-turbo version 1.2.90 (build 20130305)
remote: OptiPNG version 0.7.4
remote: | pngcrush 1.7.15
remote: -----> ImageMagick app detected
remote: -----> Install ImageMagick
remote: -----> Extracting ImageMagick /app/tmp/cache/imagemagick-6.9.9-23.7z.tar.gz => /tmp/build_c96d18fd0f8c4e48e3ec30ced800682d/vendor
remote: -----> Writing policy file
remote: -----> Updating environment variables
remote: -----> ffmpeg app detected
remote: -----> Install ffmpeg
remote: DOWNLOAD_URL = https://www.johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz
remote: exporting PATH
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.5.0
remote: -----> Installing dependencies using bundler 1.15.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.1). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: Fetching gem metadata from https://rubygems.org/.
remote: Retrying fetcher due to error (2/4): Bundler::HTTPError The checksum of /info/erubi does not match the checksum provided by the server! Something is wrong (local checksum is "\"a080a1775e4c3f8b72707ef6a2e071b4\"", was expecting "\"5512cda1-50280\"")..
remote: Retrying fetcher due to error (3/4): Bundler::HTTPError The checksum of /info/crass does not match the checksum provided by the server! Something is wrong (local checksum is "\"a080a1775e4c3f8b72707ef6a2e071b4\"", was expecting "\"5512cda1-50280\"")..
remote: Retrying fetcher due to error (4/4): Bundler::HTTPError The checksum of /info/sass-listen does not match the checksum provided by the server! Something is wrong (local checksum is "\"a080a1775e4c3f8b72707ef6a2e071b4\"", was expecting "\"5512cda1-50280\"")..
remote: The checksum of /info/et-orbi does not match the checksum provided by the
remote: server! Something is wrong (local checksum is
remote: "\"a080a1775e4c3f8b72707ef6a2e071b4\"", was expecting "\"5512cda1-50280\"").
remote: Bundler Output: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.1). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: Fetching gem metadata from https://rubygems.org/.
remote: Retrying fetcher due to error (2/4): Bundler::HTTPError The checksum of /info/erubi does not match the checksum provided by the server! Something is wrong (local checksum is "\"a080a1775e4c3f8b72707ef6a2e071b4\"", was expecting "\"5512cda1-50280\"")..
remote: Retrying fetcher due to error (3/4): Bundler::HTTPError The checksum of /info/crass does not match the checksum provided by the server! Something is wrong (local checksum is "\"a080a1775e4c3f8b72707ef6a2e071b4\"", was expecting "\"5512cda1-50280\"")..
remote: Retrying fetcher due to error (4/4): Bundler::HTTPError The checksum of /info/sass-listen does not match the checksum provided by the server! Something is wrong (local checksum is "\"a080a1775e4c3f8b72707ef6a2e071b4\"", was expecting "\"5512cda1-50280\"")..
remote: The checksum of /info/et-orbi does not match the checksum provided by the
remote: server! Something is wrong (local checksum is
remote: "\"a080a1775e4c3f8b72707ef6a2e071b4\"", was expecting "\"5512cda1-50280\"").
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to fply.
remote:
To https://git.heroku.com/fply.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/fply.git'

Related

Heroku push rejected because gems fail to install

I need some help with this small app I am trying to push to heroku after doing
git add .
git commit -m "message here"
git push heroku master
I get the following error message:
Enumerating objects: 174, done.
Counting objects: 100% (174/174), done.
Delta compression using up to 12 threads
Compressing objects: 100% (156/156), done.
Writing objects: 100% (174/174), 38.41 KiB | 2.40 MiB/s, done.
Total 174 (delta 62), reused 36 (delta 3)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.3.10
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.3.10
remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote: /usr/bin/env: ‘ruby\r’: No such file or directory
remote: Bundler Output: /usr/bin/env: ‘ruby\r’: No such file or directory
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...
remote:
remote: ! Push rejected to damp-spire-06287.
remote:
To https://git.heroku.com/damp-spire-06287.git
! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/damp-spire-06287.git
I am not sure if it is an issue with the bundler version or something else but I need any help if possible. I have tried doing
bundle install and bundle update
and the bundle completes without a hitch. I have been stuck for a while and tried replacing the bundle version to no avail. Thanks in advance!
This error is caused because you have incorrect line endings (CRLF vs. LF) in your repo, which is generally caused when you are working/deploying across Windows and Unix-like environments. Mac/Unix/Linux environments -- which Heroku uses -- use a single linefeed (usually denoted \n) character to terminate a line while Windows uses a carriage return/linefeed pair (\r\n).
If your local repo is on a Windows machine you'll need to convert the files in your repo before pushing to Heroku. You can configure Git to handle the auto-conversion so that you have Windows terminators when you checkout on Windows but maintain the repo with just linefeeds.
To set up the automatic conversion:
% git config --global core.autocrlf input
Git also provides a way to refresh your repo to ensure all the line endings are correct. This can cause merge headaches since this can affect every line in some/all files, so you preferably want to do this on a fully up-to-date repo (i.e., no un-pushed changes).
% git add --renormalize .
% git commit -m "Normalize all the line endings"
https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings

Heroku Deploying: Failed to install gems via Bundler

While trying to deploy my app to heroku, I get this error:
remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote: Detected buildpacks: Ruby,Node.js
remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.3.10
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.7.5
remote: -----> Installing dependencies using bundler 2.3.10
remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote: Your bundle only supports platforms ["x86_64-darwin-21"] but your local platform
remote: is x86_64-linux. Add the current platform to the lockfile with
remote: `bundle lock --add-platform x86_64-linux` and try again.
remote: Bundler Output: Your bundle only supports platforms ["x86_64-darwin-21"] but your local platform
remote: is x86_64-linux. Add the current platform to the lockfile with
remote: `bundle lock --add-platform x86_64-linux` and try again.
remote:
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: b841b157d86386b34d46224f6f00301501c82b49
remote: !
remote: ! We have detected that you have triggered a build from source code with version b841b157d86386b34d46224f6f00301501c82b49
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to radiant-citadel-26297.
remote:
To https://git.heroku.com/radiant-citadel-26297.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/radiant-citadel-26297.git'
I have already tried
bundle lock --add-platform x86_64-linux
but didnt work. I have also tried to solve it with other methods, such as "bundle lock --add-platform ruby", with no success.
Please help!
The problem I had was that I was did not added, commited and pushed. This solved the issue: '
bundle lock --add-platform x86_64-linux
git add -A
git commit -m 'Add platform'
git push
'

Heroku: Cannot push to heroku due to NoMethodError

I ran git push heroic master and got this long error message(truncated it). If I'm not wrong, this is the main cause of the problem remote: NoMethodError: undefined method 'split' for {}:Hash. How do I solve this problem from the terminal, even though the code runs on local machine. Please inform me if more information is required, and perhaps tell me what's wrong here.
Total 0 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote: Detected buildpacks: Ruby,Node.js
remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.5.3
remote:
remote: ###### WARNING:
remote:
remote: You have the `.bundle/config` file checked into your repositor
remote: It contains local state like the location of the installed bundle
remote: as well as configured git local gems, and other settings that should
remote: not be shared between multiple checkouts of a single repo. Please
remote: remove the `.bundle/` folder from your repo and add it to your `.gitignore` file.
remote: https://devcenter.heroku.com/articles/bundler-configuration
remote:
remote: -----> Installing dependencies using bundler 1.15.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: --- ERROR REPORT TEMPLATE -------------------------------------------------------
remote: # Error Report
remote:
remote: ## Questions
remote:
remote: Please fill out answers to these questions, it'll help us figure out
remote: why things are going wrong.
remote:
remote: - **What did you do?**
remote:
remote: I ran the command `vendor/bundle/ruby/2.5.0/bin/bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment --no-clean`
remote:
remote: - **What did you expect to happen?**
remote:
remote: I expected Bundler to...
remote:
remote: - **What happened instead?**
remote:
remote: Instead, what happened was...
remote:
remote: - **Have you tried any solutions posted on similar issues in our issue tracker, stack overflow, or google?**
remote:
remote: I tried...
remote:
remote: - **Have you read our issues document, https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md?**
remote:
remote: ...
remote:
remote: ## Backtrace
remote:
remote: ```
remote: NoMethodError: undefined method `split' for {}:Hash
remote: /tmp/build_571ced5049bd8f6d5aa742e589ae07bf/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/settings.rb:253:in `get_array'
remote: /tmp/build_571ced5049bd8f6d5aa742e589ae07bf/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/settings.rb:179:in `without'
remote: /tmp/build_571ced5049bd8f6d5aa742e589ae07bf/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli/install.rb:169:in `normalize_groups'
remote: /tmp/build_571ced5049bd8f6d5aa742e589ae07bf/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli/install.rb:24:in `run'
remote: /tmp/build_571ced5049bd8f6d5aa742e589ae07bf/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli.rb:186:in `block in install'
remote: /tmp/build_571ced5049bd8f6d5aa742e589ae07bf/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/settings.rb:92:in `temporary'
remote: /tmp/build_571ced5049bd8f6d5aa742e589ae07bf/vendor/bundle/ruby/2.5.0/gems/bundler-1.15.2/lib/bundler/cli.rb:185:in `install'
.bundle/config
---
BUNDLE_WITHOUT: ""
The logs are warning you about that you have .bundle/config checked on your version control.
Remove from your repo and push your changes
rm .bundle/config
rmdir .bundle

Errors with "git push heroic master", what to do?

So i'm trying to deploy my rails app through heroku. But every time i run "git push heroic master", i run into this. I have searched around, but nothing seems to work. I have tried to "bundle update", "bundle install", but i still get this error when i run "git push heroic master"
Counting objects: 84, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (70/70), done.
Writing objects: 100% (84/84), 20.65 KiB | 1.88 MiB/s, done.
Total 84 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote: Detected buildpacks: Ruby,Node.js
remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.3.4
remote: -----> Installing dependencies using bundler 1.15.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.1). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: You are trying to install in deployment mode after changing
remote: your Gemfile. Run `bundle install` elsewhere and add the
remote: updated Gemfile.lock to version control.
remote: The dependencies in your gemfile changed
remote: You have added to the Gemfile:
remote: * pg
remote: Bundler Output: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.1). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: You are trying to install in deployment mode after changing
remote: your Gemfile. Run `bundle install` elsewhere and add the
remote: updated Gemfile.lock to version control.
remote:
remote: The dependencies in your gemfile changed
remote:
remote: You have added to the Gemfile:
remote: * pg
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to secret-mesa-55611.
remote:
To https://git.heroku.com/******
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/*******.git'
It seems that your Gemfile.lock is changed. Try running bundle install after cleaning the Gemfile.lock

Could not find thread_safe-0.3.5 in any of the sources

I get this error while running cap production deploy on a Ubuntu 14.04 server.
It seems like a similar issue to here, but I've tried all the answers here but can't get it working Could not find thread_safe-0.3.0 in any of the sources.
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as root#*serveripaddress*: bundle exit status: 7
bundle stdout: Could not find thread_safe-0.3.5 in any of the sources
bundle stderr: Nothing written
SSHKit::Command::Failed: bundle exit status: 7
bundle stdout: Could not find thread_safe-0.3.5 in any of the sources
bundle stderr: Nothing written
Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as root#*serveripaddress*: bundle exit status: 7
bundle stdout: Could not find thread_safe-0.3.5 in any of the sources
bundle stderr: Nothing written
Update: I've tried deploying to Heroku and get a similar error. If anyone has any advice it would be great.
$ git push heroku master
Counting objects: 10017, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7613/7613), done.
Writing objects: 100% (10017/10017), 22.27 MiB | 87.00 KiB/s, done.
Total 10017 (delta 2426), reused 7631 (delta 1548)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote: Detected buildpacks: Ruby, Node.js
remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.0.0
remote: -----> Installing dependencies using 1.7.12
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Some gems seem to be missing from your vendor/cache directory.
remote: Could not find thread_safe-0.3.5 in any of the sources
remote: Bundler Output: Some gems seem to be missing from your vendor/cache directory.
remote: Could not find thread_safe-0.3.5 in any of the sources
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to mysterious-badlands-3241.
remote:

Resources