Heroku: Push Rejected, Failed to Compile Ruby App

heroku push rejected, failed to compile Ruby/rails app

try this,

remove Gemfile.lock file and do bundle install , then git add, git commit and git push .

heroku push rejected, failed to compile Ruby app

I was actually able to solve the issue. I found out I was trying to push the project to another branch (not the master branch). I solved the issue by merging the branch with master branch and pushed it again.

Push rejected, failed to compile Ruby app to heroku

It seems to be a problem related to the ruby version Heroku is using. You could try setting the ruby version so Heroku uses the same one as you use locally.

Heroku push rejected because gems fail to install

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



Related Topics



Leave a reply



Submit