4

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 git@heroku.com:APP_NAME_HERE.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:APP_NAME_HERE.git'
Nick McCurdy
  • 17,658
  • 5
  • 50
  • 82

3 Answers3

4

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:

georgebrock
  • 28,393
  • 13
  • 77
  • 72
  • Those files are existing and committed. I looked at those articles on the Profile, and created one with the contents `web: bundle exec rackup config.ru -p $PORT`. Heroku still gives me the same error when I push, and running `foreman start` locally results in this error: https://gist.github.com/c8957f5323adf82d0b96. Adding `gem 'bundler', '>= 1.0.0'` to my Gemfile did not fix the issue either. – Nick McCurdy Aug 24 '12 at 07:35
  • 2
    Note the `config.ru` must be in your root directory, not in a subdirectory. Where is it? – Jon Mountjoy Aug 24 '12 at 11:20
  • The root directory of my app/repo, correct? If so, it's there. – Nick McCurdy Aug 24 '12 at 23:16
  • 1
    Can you post the output of `git ls-files` somewhere? – georgebrock Aug 25 '12 at 11:54
  • Good idea, done. I cut some of the output out at points mainly for brevity (where there were tons of image files). https://gist.github.com/82e8aa571727ca07a34c – Nick McCurdy Aug 25 '12 at 19:43
  • 1
    Your file list looks good to me. I suggest you talk to Heroku support, their IRC channel has proved useful to me in the past. – georgebrock Aug 26 '12 at 00:36
  • Thank you! Do you know if I can get free official support there? I'm new to Heroku, and plan to stay in the free tier for a while. Also, where is the channel? "heroku" on freenode? – Nick McCurdy Aug 26 '12 at 07:05
4

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.

Nick McCurdy
  • 17,658
  • 5
  • 50
  • 82
2

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

Community
  • 1
  • 1
James P McGrath
  • 1,856
  • 1
  • 20
  • 35