Nicky McCurdy
Nicky McCurdy

Reputation: 19554

"Heroku push rejected, no Cedar-supported app detected" when trying to upload a Sinatra app with an existing git repo

I have an existing git repo for my personal website, which I am porting to Sinatra (mainly for templating, it's a static site). I do NOT want to lose/reset this git repository.

When I try to push to Heroku, I get the error below. I have a config.ru file, a Gemfile, and a Gemfile.lock, along with some other stuff for Sinatra. Running rackup works, running bundle exec rackup works, and I didn't get any warnings from Heroku about missing dependencies.

Am I missing something? I can post the directory structure of my site if it would help (though it's close sourced).

~/Repos/website ➜ gp heroku master
Counting objects: 2836, done.
Compressing objects: 100% (2669/2669), done.
Writing objects: 100% (2836/2836), 3.48 MiB | 252 KiB/s, done.
Total 2836 (delta 481), reused 2117 (delta 155)

-----> Heroku receiving push
 !     Heroku push rejected, no Cedar-supported app detected

To [email protected]:APP_NAME_HERE.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:APP_NAME_HERE.git'

Upvotes: 4

Views: 6923

Answers (3)

James P McGrath
James P McGrath

Reputation: 1884

For those who find that the accepted answer doesn't solve their problem, this related question may provide the solution: "Heroku push rejected, no Cedar-supported app detected" when trying to upload a Sinatra app with an existing git repo

Upvotes: 2

Nicky McCurdy
Nicky McCurdy

Reputation: 19554

Problem solved. I was working on a git branch especially for Heroku/Sinatra support, and it turns out I was running git push heroku master, which pushed local master to remote master. The master branch did not have a valid Heroku app. I assumed it would push the current local branch to the remote master branch, which is not the case. git push sinatra:master solved the issue.

Upvotes: 4

georgebrock
georgebrock

Reputation: 30043

A Cedar app should recognise the config.ru file and create a web process for you, so it's possible that some essential file is not tracked by git. Check that config.ru, Gemfile and Gemfile.lock are all committed (you can use git status, but note that it will not output anything for ignored files so you should also check your .gitignore file).

If all the files are committed, you could also try specifying the command you want the web process to use in a Procfile. See the Heroku docs for more information:

Upvotes: 4

Related Questions