Heroku push rejected, no Cedar-supported app detected - ruby-on-rails

I'm creating a Rails app with Rails 3.1.3:
git init
git remote add heroku <my heroku repo>
git add .
git commit -a -m "First commit"
git push heroku master
Got:
Counting objects: 102, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (86/86), done.
Writing objects: 100% (102/102), 315.47 KiB, done.
Total 102 (delta 3), reused 0 (delta 0)
**-----> Heroku receiving push
! Heroku push rejected, no Cedar-supported app detected**
To git#heroku.com:electric-dusk-3217.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to <my heroku rep>

I had a similar problem, but with Django (incorrectly named "requirements.txt"). I think to generalize the other answers here, when you get this error it's because Heroku is missing some key file that it uses to identify your app (and its type).
php: index.php
python: requirements.txt
ruby: Gemfile # note the capitalization
node: package.json

The problem was that my "Gemfile" was named "gemfile"

I ran into this error message, but my problem was that my rails app was not in the root directory of my git repo. After I moved the files into the root dir, everything worked.

Heroku detects a supported app by looking for specific project files. To find the requirements for your language, start here.
For Node.js, you need a package.json.
For Python applications you need a requirements.txt.
etc.

Not associated with a new app, but... I ran into this same error message after installing a custom BUILDPACK on heroku and then forgetting about it. The next time I went to deploy to heroku I saw:
-----> Fetching custom git buildpack... done
! Push rejected, no Cedar-supported app detected
The fix was to check:
heroku config
And, there, I found a Var called BUILDPACK_URL which I had to unset with:
heroku config:unset BUILDPACK_URL
... and voila!

Another cause: I was pushing master, while working on a non-master branch. My master branch didn't have requirements.txt.
I didn't want to push from master, but heroku only pays attention to the master branch. The solution was to push my local branch to heroku's master branch:
git push heroku local_branch:master

Another cause of this error for Rails apps: we had this deploy error occur when we hadn't removed a git merge conflict from our Gemfile.lock file.

I had the same issue. "Gemfile" was included in ".gitignore" and has therefore not been part of the deployment. Heroku requires Gemfile for Rails projects.

I fixed this by making a superficial change to my Gemfile and recommitting. For some reason it wasn't included in my last commit.

I met the same problem here.
My check as follow:
1. Make sure "foreman start" works well locally.
2. Make sure only one new app create on your heroku account.
Hope it help.

I was following the RailsTutorial.org steps and this error showed up. None of the answers on this post worked. Then I saw this comment that led to this answer which was the only thing that worked for me so that might solve other people's problems with the tutorial as well.

When this problem appears with the project based on static files (only html, css and js) it is recommended to follow this guidlines:
https://discussion.heroku.com/t/push-rejected-no-cedar-supported-app-detected/640/3

I also had the problem with django based app. Everything seemed to be ok: file names and other settings.
The problem was that in heroku console there was a BUILDPACK_URL setting defined for node.js - thus django application was rejected.

Related

Pushing to Heroku with Rails/ruby

I am trying to push to Heroku. I have postgres and have set the buildpacks for Heroku. However I believe it is my file structure that is causing the error.
Main-File -> ProjectName -> RubyProj ->(this is where all the ruby controllers gem stuff is)
Main-File is my git repo and I am trying to push just the RubyProj file to heroku Is there a good way to do this without doing another git init on the RubyProj file?
Actually, it is possible to push only your RubyProj file to heroku, but I don't understand which type of error are you encountering. Try to switch to the appropriate git branch and push the project from the terminal.
cd ~/ProjectName/RubyProj
git checkout master
git commit -m
heroku create
git push heroku master
Also check all the gems and correct bundle installation.
Maybe this book will help you. https://www.railstutorial.org/book/beginning#sec-deploying
Good luck, hope I helped you!

Heroku Problems: Not able to deploy app for some reason

I am trying to deploy a basic app from Github to Heroku.
Following directions from Heroku's guide
Here's the thing. When I clone from the github repository, I clone a specific branch that's 8 commits ahead of master.
The reason why I clone that specific branch is that it's the most advanced on. Each branch is built upon the previous branch.
I don't want to merge that branch into the master because I don't know how to undo that.
By the time I try to do this step from the guide above: heroku ps:scale web=1, I always get this: Scaling dynos... failed
! App must be deployed before dynos can be scaled.
Why does this happen? Advice?
Please let me know if this question needs further clarification. Thank you.
EDIT
For the record, it has the Procfile which has this in it: web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
EDIT 2
When I do git push heroku branch_name - this is what I get:
Delta compression using up to 4 threads.
Compressing objects: 100% (243/243), done.
Writing objects: 100% (389/389), 727.55 KiB | 0 bytes/s, done.
Total 389 (delta 111), reused 389 (delta 111)
remote: Pushed to non-master branch, skipping build.
EDIT 3
I followed the first answer from this thread.
It worked, and restarted the app in Heroku.
But I restarted it again with this line: heroku restart --app name_of_app_in_heroku and got this: Restarting dynos... done
Then I tried to do heroku open --app name_of_app_in_heroku, and all I get is the basic welcome page. How do I overcome this?
Also, I just looked at my Heroku's dashboard, and checked the app, and it says it has no dynos. How is that possible?
EDIT 4
Also, I just ran this command: heroku pg:info and got this answer: name_of_app_in_heroku has no heroku-postgresql databases.
But that shouldn't be, I can see the DB's URL in the app's config vars in the settings of the app's dashboard.
It sounds like the app's never been deployed (because you're trying to deploy non master branch and heroku has been ignoring the pushes)
When you push to heroku, the name for the branch needs to be master on the heroku side.
By default git push keeps the same name for both sides:
git push heroku some_branch
Tries to (assuming upstream is setup appropriately etc) update a branch called "some_branch" on the heroku remote, with your local branch of the same name.
To use a different name you'd do
git push heroku some_branch:master
Which means push the changes from the branch called some_branch locally to heroku's master branch
When you deploy your app try doing this
gp heroku master -f
heroku run rake db:migrate --app APPNAME
heroku restart --app APPNAME
heroku open --app APPNAME
This are the lines that I use when I deploy a project to Heroku

Heroku Core Data buildpack, no cedar supported app detected

I'm attempting to migrate an existing Core Data (with local store) project to Heroku using AFIncrementalStore and the Core Data Buildpack, but pushing to Heroku keeps failing.
The primary differences between my app setup and that in the aforelinked tutorial:
I've set up the Xcode workspace with the AFNetworking/AFIncremental dependencies, but not actually changed any code yet.
The directory containing the Xcode project/workspace files is one level down from the root of my git repo. This means heroku create --buildpack git://github.com/mattt/heroku-buildpack-core-data.git fails to create the git remote named heroku, but I can cd .. and heroku git:remote -a appname and that seems to be cool.
I'm working on a branch other than master in my git repo, so when I push to Heroku I need to use git push heroku my_local_branch:master.
However, that git push doesn't get anywhere, not even into the Core Data Buildpack stuff (as far as I can tell):
-----> Fetching custom git buildpack... done
! Heroku push rejected, no Cedar-supported app detected
To git#heroku.com:appname.git
! [remote rejected] my_local_branch -> master (pre-receive hook declined)
I just went through one of my projects and arranged it to mimic yours.
The buildpack will fail if the .xcdatamodeld isn't within 1 folder level of root. I suggest filing an issue on Github.
When you created the Heroku app, maybe you didn't pass in the --buildpack parameter. You can check by running heroku config and verify there's a BUILDPACK_URL setting pointing at the buildpack repo. If that's missing, you can add it:
heroku config:add BUILDPACK_URL=https://github.com/some/buildpack.git -a myapp
Documentation here.

How to reset everything Heroku in my Git/Rails 3.1 Project

I solved my problem while writing this post, but I thought this might be good information for other noobs like me :)
To solve the problem below edit the following file
.git/config
There's a section that looks like this
[remote "heroku"]
url = git#heroku.com:adjective-noun-1234.git
fetch = +refs/heads/*:refs/remotes/heroku/*
This is what git tries to push to. Just change the line
url = git#heroku.com:adjective-noun-1234.git
to whatever new Heroku project you created. Git should now be able to push to Heroku again.
I have gotten my second Rails app ever to a working state and want to deploy it. So I followed all the steps for Heroku deployment in the Ruby on Rails Tutorial (I had the deployment working for the sample app from the book) using:
heroku create
I then push my project with
git push heroku master
The project doesn't work although I can't find any errors in the Heroku logs, all I get is:
We're sorry, but something went wrong.
We've been notified about this issue and we'll take a look at it
shortly.
So I looked around the Heroku Support Section and found the official Rails 3.0 / 3.1 deployment guide:
http://devcenter.heroku.com/articles/rails3
http://devcenter.heroku.com/articles/rails31_heroku_cedar
I went to the Heroku Web Frontend > General Info > Destroy App because I wanted to continue my efforts with a clean slate.
Following the guide I created a Heroku project for the cedar stack:
heroku create --stack cedar
And push it to Heroku using
git push heroku master
THE PROBLEM: for some reason git is still trying to push to the old Heroku project!!!
resulting in an error
fatal: The remote end hung up unexpectedly
Check your remote repositories, and update it to the new heroku name:
git remote -v
Then remove the heroku one that is wrong:
git remote rm heroku
Then add the new one
git remote add heroku git#heroku.com:sitename.git
This is a bit extreme, but worked for me....
heroku destroy appname
heroku create
git push heroku master

cloned project from github. heroku does not work

I cloned a project from github over to my desktop. I used to work on it form my laptop.
However, on laptop heroku does not seem to work for this app eventhough i have it installed.
First problem:
heroku open
>No app specified.
>Run this command from app folder or set it adding --app <app name>
I did not have to specify the --app on my laptop. Because I guess I did command heroku create initially on the lapop.
Second Probelm:
git push heroku master
gives errors
fatal: 'heroku' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
and heroku list
says
! This version of the heroku gem has been deprecated.
! Please update it by running: gem update heroku
First do:
git remote add heroku git#heroku.com:{my-project-name}.git
Where you replace {my-project-name} with the name of the Heroku application as it appears in your Heroku account. For example, if your Heroku account says you have an application named flowing-water-397, then the line would be:
git remote add heroku git#heroku.com:flowing-water-397.git
Then Git and the Heroku gem will know that this Git repo is connected to a Heroku.com application. Then you can do things such as:
git push heroku master
heroku open
Finally, learn a little bit more about Git Remotes.
In addition to the git remote add ... that #Justice mentioned, I also needed to run
git config heroku.remote heroku
(solution found here)
I believe I get the error No app specified. Run this command from an app folder or specify which app to use with --app when I run any ambiguous heroku commands. Example:
heroku logs
It's ambiguous because I have multiple remote repositories specified in my project's .git/config file. The solution for me is simply to specify the remote repository. Example:
heroku logs --remote staging
In the above line --remote staging corresponds to the following in my project's .git/config file:
[remote "staging"]
url = git#heroku.accountname:foo-bar-1234.git
fetch = +refs/heads/*:refs/remotes/staging/*
I hope this helps you.. if not, then perhaps it may help someone else!
When I had this issue it was because I created more than one remote app on heroku.
To remove an existing remote app from heroku use:
git remote rm heroku
then go back and use heroku create to start the process over using the correct app name heroku gives you.
Solution found here:
solution

Resources