Cannot push git repo to Heroku - ruby-on-rails

I try to push my git repo to Heroku, but I get error:
remote: -----> Installing node-v12.16.2-linux-x64
remote: -----> Detecting rake tasks
remote:
remote: !
remote: ! Could not detect rake tasks
remote: ! ensure you can run `$ bundle exec rake -P` against your app
remote: ! and using the production group of your Gemfile.
remote: ! /tmp/build_641166cf/bin/rake:8:in `require': cannot load such file -- rake (LoadError)
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: 93a5bb6ab6e77c479f857031010316f9f372e20f
remote: !
remote: ! We have detected that you have triggered a build from source code with version 93a5bb6ab6e77c479f857031010316f9f372e20f
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 whispering-fortress-58873.
remote:
To https://git.heroku.com/whispering-fortress-58873.git
! [remote rejected] master -> master (pre-receive hook declined)
error: не удалось отправить некоторые ссылки в «https://git.heroku.com/whispering-fortress-58873.git»
How to fix it? I've been trying to fix this for two days now.
Ruby version: 2.7.2
Rails version: 5.2.4.4
Gem version: 3.1.4
Bundler version: 2.2.7

Checking error logs it seems that you need to push your branch to main
Try the following (or replace master with your current branch)
git push heroku master:main

Related

Warning - The same version of this code has already been built: a48a4daf97c0fa4bd7bdb4a442cff3fbc97c47c8

How can i solve this issue?
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: a48a4daf97c0fa4bd7bdb4a442cff3fbc97c47c8
remote: !
remote: ! We have detected that you have triggered a build from source code with version a48a4daf97c0fa4bd7bdb4a442cff3fbc97c47c8
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 :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 katch-up.
I am using Rails 5.2.1

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
'

failed to push to heroku (pre-receive hook declined)

remote: -----> Compressing...
remote:
! Compiled slug size: 917.2M is too large (max is 500M).
remote: ! See: http://devcenter.heroku.com/articles/slug-size
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 5788bbafef87b6c05d42cc0d2d3175846ae109bf
remote: !
remote: ! We have detected that you have triggered a build from source code with version 5788bbafef87b6c05d42cc0d2d3175846ae109bf
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 appname.
remote:
To https://git.heroku.com/appname.git
please help! have already cleared the cache of the buildpacks. that didn't seem to work. tried pushing code to a different branch and that didn't work either. not sure what's going on. I am the only one working on this project and have only been pushing on master. My app has a lot of photo files don't know if thats the issue?

git push Heroku "Precompiling assets failed"

When I try and push my rails app to Heroku, I get the following problem:
remote: (See full trace by running task with --trace)
remote:
remote: !
remote: ! Precompiling assets failed.
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: 50f04b554cf0d361879bf0f70d7c445ed0c3a480
remote: !
remote: ! We have detected that you have triggered a build from source code with version 50f04b554cf0d361879bf0f70d7c445ed0c3a480
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 defaceme.
remote:
To https://git.heroku.com/defaceme.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/defaceme.git'
edithkenny#Georginas-MBP defaceme %
I have updates my username on my computer, im not sure if this affected my terminal...Any ideas?

RoR Could not find fog-aws-0.7.0 in any of the sources

I have problem with heroku, when I try to push it, Could not find fog-aws-0.7.0 in any of the sources.
remote: Could not find fog-aws-0.7.0 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 sample-app-kong.
remote:
To https://git.heroku.com/sample-app-kong.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/sample-app-kong.git'
Version 0.7.0 of the fog-aws gem has been removed from the Rubygems server.
If you run bundle update fog-aws in your project folder, bundler will try to load the latest version of the gem instead, and then you'll be able to push to Heroku
Now I fix it run git push -f heroku

Resources