简体   繁体   中英

“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 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'

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:

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.

对于那些发现已接受的答案无法解决问题的人,这个相关的问题可能会提供解决方案: “Heroku推送被拒绝,没有检测到Cedar支持的应用程序”,当尝试上传带有现有git仓库的Sinatra应用程序时

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM