85

I'm working in rails 3.2 and I receive an error when I try to push to heroku:

 git push heroku master
Counting objects: 496, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (435/435), done.
Writing objects: 100% (496/496), 5.17 MiB | 249 KiB/s, done.
Total 496 (delta 125), reused 216 (delta 8)

-----> Heroku receiving push
-----> Removing .DS_Store files
 !     Heroku push rejected, no Cedar-supported app detected

To git@heroku.com:lumeo.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:lumeo.git'

I have tried the few methods recommended on this forum, including emptying and reinstalling the Gems and deleting and adding the remote, to no avail.

any suggestions?

Brian McDonough
  • 13,829
  • 4
  • 19
  • 23
  • Reinitializing the repo worked for me, details here: http://stackoverflow.com/questions/9305370/rails-3-2-heroku-push-rejected-no-cedar-supported-app-detected – Dan Klos Oct 01 '15 at 20:45

29 Answers29

29

Make sure that your Rails app is in the root of the repo, the Gemfile is present and properly named. It is basically not able to detect your code base as one of the supported project types and hence failing it. Also, even if you do have a proper project, make sure it is part of the repository and you have committed it fine (git status will help you here and a ls should help you verify the project structure).

TuralAsgar
  • 1,275
  • 2
  • 13
  • 26
manojlds
  • 290,304
  • 63
  • 469
  • 417
28

In Heroku, you may have problems with pushing to the master branch. What you can do is to start a new branch using

git checkout -b tempbranch

and then push using

git push heroku tempbranch

Bora
  • 1,402
  • 16
  • 19
  • It's working fine after created a new branch from master and pushing from there – CodecPM Jan 25 '17 at 11:03
  • In my case I merged master into a pre-existing branch and pushed. No idea why it works but the push was successful. – Mugshep Dec 10 '17 at 11:51
25

If you run $ heroku logs you may get a "hint" to what the problem is. For me, Heroku could not detect what type of app I was creating. It required me to set the buildpack. Since I was creating a Node.js app, I just had to run $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-nodejs. You can read more about it here: https://devcenter.heroku.com/articles/buildpacks. No pushing issues after that.

I know this is an old question, but still posting this here incase someone else gets stuck.

Chelsea
  • 431
  • 4
  • 5
9

You might also want to check for Heroku telling you there's a typo in your CSS file.

Read through the long boring messages in the terminal closely after you push. There may be something like this: Invalid CSS after. It means Heroku has found a typo and you need to fix it in the CSS file.

You can do a find for rake aborted! and directly after that it should say why the push failed.

PanicBus
  • 566
  • 1
  • 7
  • 17
6

If you get this error and the terminal is not descriptive enough to help you, Heroku might be able to tell you what is wrong through their website. Try the following:

  1. log in to Heroku and go to your dashboard;
  2. select the problem application from the list; and,
  3. check the build logs under the "Activity" tab.

In my case, I had accidentally ignored my Gemfile.lock.

februaryInk
  • 705
  • 1
  • 8
  • 15
  • thank you this fix my bug, i had two different lockfiles in my project: package-lock.json and yarn.lock, so i deleted the latter by: git rm yarn.lock. – Ismail Oct 07 '21 at 14:08
2

Specify the version of node The version of Node.js that will be used to run your application on Heroku, should also be defined in your package.json file. You should always specify a Node.js version that matches the runtime you’re developing and testing with. To find your version type node --version.

Your package.json file will look something like this:

"engines": { "node": "10.x" },

It should work

2

I had the same issue.

Look at your git ignore and check if .env is not ignored.

It was my problem and resolved to my case.

Caio Euzébio
  • 182
  • 1
  • 1
  • 10
1

The package setuptools/distribute is listed in requirements.txt. Please remove the same.

Savad KP
  • 1,625
  • 3
  • 28
  • 40
1

For completeness, the issue may be heroku itself. In rare cases like these https://status.heroku.com would show something along the lines of:

Update

The Heroku Dashboard and Elements have been restored. We are still working to restore the other affected services.

The services still affected are:

  • Builds
  • Review apps
  • Pipelines
  • Github deploys
  • Heroku CI
  • Heroku Buttons

I was able to deploy about 40 minutes later after heroku reported:

All affected services have been restored and are now working as expected. We will be monitoring to ensure there are no further issues.

Arta
  • 5,127
  • 5
  • 25
  • 23
1

My initial error in overview building log was... /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/bin/support/ruby_compile:15:in' ! Push rejected, failed to compile Ruby app. ! Push failed`

Through 2 days of trying...this worked heroku buildpacks:set https://github.com/heroku/heroku-buildpack-nodejs

In part it was my proxy and the buildpack

1

just in case you have this problem while trying to push a django app to heroku and then you get this error:

! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to https://git.heroku.com/app_name.git

simply look for this :

Error while running '$ python manage.py collectstatic --noinput'. remote: See traceback above for details. remote: remote: You may need to update the application code to resolve this error. remote: Or, you can disable collectstatic for this application: remote: remote: $ Heroku config:set DISABLE_COLLECTSTATIC=1

Copy this : $ Heroku config:set DISABLE_COLLECTSTATIC=1

and paste it in the terminal. Press Enter and after that run: $ git push Heroku master

This should solve your problem if Django app is what you are trying to push.

Cindy Meister
  • 25,071
  • 21
  • 34
  • 43
  • I am new in node.js. Your comment gave me idea to look for my own error (which was different) and I resolved it otherwise I was thinking it was related to git and refs and was searching online for such solution. Thank you. – Sourab Sharma Mar 07 '20 at 12:28
1

I also faced the same issue The solution for this is

Delete the package-lock.json file on both the client and server

Make sure that you are using at least the LTS version of Node locally

Make sure your local Node version matches what is shown in the package.json file's engines property.

Run the git add . , git commit -m "fixing versions" and git push heroku master commands to force a rebuild.

1

Try to change your role to the role of the maintainer of the project before pushing...

This solved my issue for me.

0

I was getting the same error, and running the following code in the command line solved it:

$ heroku config:set BUNDLE_WITHOUT="development:test"
julienc
  • 19,087
  • 17
  • 82
  • 82
0

I got the same error when I ran git status :

$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean

To fix it I can run:

$ git push and run 
$ git push heroku master
Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
learningBunny
  • 69
  • 1
  • 3
0

In my case I had forgotten to use postgres in my production environment. I moved the sqlite3 gem into my development and test groups in my Gemfile. Everything worked after that.

RobertJoseph
  • 7,968
  • 12
  • 68
  • 113
0

Check the following

  1. Make sure you add all the files and directories needed to be tracked are added using git status [You have done this]

    $ git status

  2. If not added then add them using **git add . ** [You have done this]

    $ git add .

  3. Bundle all gems and you will have Gemfile.lock

    $ bundle install
    $ git add Gemfile.lock
    $ git commit -am "Added Gemfile.lock"

  4. Push it to heroku

$ git push heroku master

Your push should work

V4veduke
  • 1
  • 1
0

I was facing the same problem.

[remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to ""

Cause of Error :
I was in develop branch and trying to push to remote master branch

Solution:
Checkout to develop branch(another branch) and execute :

git push heroku develop 
Vineeth Sai
  • 3,389
  • 7
  • 23
  • 34
RameshD
  • 912
  • 7
  • 6
0

I have just run the heroku logs command and checked the git status then retried the git push hreoku master and it worked

0

Mine finally worked somewhere along this road:

  1. Updating Git
  2. back to \my_first_rail_app\, type or run:
    • a. bundle install
    • b. bundle install --gemfile
    • c. bundle update
    • d. git add .
    • e. git commit -m "updates for heroku deployment"
    • f. git pust heroku master (still wont work with my case)
    • g. heroku buildpacks:set https://github.com/bundler/heroku-buildpack-bundler2
Gustavo Pagani
  • 6,583
  • 5
  • 40
  • 71
david
  • 1
0

simple answer

$ heroku config:set DISABLE_COLLECTSTATIC=1

after

$ git push heroku master

J Zero
  • 43
  • 7
0

You might need to update the heroku version heroku update. I recently had that issue then I updated from version 7.42.2 to 7.47.5

my engine version is "engines": {"node":"14.8.0","npm":"6.14.7"}

Arjjun
  • 1,203
  • 16
  • 15
0

Checking and updating the requirements.txt actually worked for me. I had a few wrong package names. Remember to commit before pushing!

nsde
  • 92
  • 6
0

In my case, the issue was Node Modules which was also being pushed (not included in .gitignore). I referred this and my issues was resolved.

echo 'node_modules' >> .gitignore
git rm -r --cached node_modules
git commit -am 'ignore node_modules'
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 24 '21 at 05:30
0

I had the same issue. I had two different lock files in my folder, package-lock.json, and yarn.lock, then I deleted the yarn.lock file and it worked smoothly.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 24 '21 at 04:43
0

enter image description here

In my own case, I tried deleting the node_module, package-lock.json and ran npm install but none of this worked. found out Heroku was using a lower version of node. Addin this to my package.json solved it.

"engines":{
"node":"16.x"
},
Pope Francis
  • 557
  • 8
  • 9
0

I had the same issue. check that you make git init on the backend folder!!

idan noyshul
  • 151
  • 1
  • 9
0

try add this to the pom file

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
    </configuration>
</plugin>
-1

I got the same error and looked into activity. Where I found that I had two package lock files which was causing the error.

kapil
  • 1,710
  • 1
  • 15
  • 12