Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't push to the heroku

I was pushing the current git repository into the heroku. That online application was developed using Scala and IntelliJ. And I don't know how to fix this error.

$ git push heroku master Counting objects: 3, done. Delta compression using up to 4 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 531 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote:  remote:  !     No default language could be detected for this app. remote:             HINT: This occurs when Heroku cannot detect the         buildpack to use for this application automatically. remote:             See https://devcenter.heroku.com/articles/buildpacks remote:  remote:  !     Push failed remote: Verifying deploy.... remote:  remote: !   Push rejected to salty-coast-14102. remote:  To https://git.heroku.com/salty-coast-14102.git  ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/salty-coast-14102.git' 
like image 465
이국화 Avatar asked Aug 09 '16 02:08

이국화


People also ask

Why push is failing in Heroku?

This error means that the upstream repository has made commits that would be lost if you were to push. First do a "git pull" to merge, and then push again.

How do I force push to Heroku?

To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.

Can you push to Heroku without GitHub?

You can use https://github.com/ddollar/heroku-push and push directories without git.


2 Answers

Read this doc which will explain to you what to do.
https://devcenter.heroku.com/articles/buildpacks

Setting a buildpack on an application

You can change the buildpack used by an application by setting the buildpack value.
When the application is next pushed, the new buildpack will be used.

$ heroku buildpacks:set heroku/php 

Buildpack set. Next release on random-app-1234 will use heroku/php.
Run git push heroku master to create a new release using this buildpack.

This is whay its not working for you since you did not set it up.

... When the application is next pushed, the new buildpack will be used.

You may also specify a buildpack during app creation:

$ heroku create myapp --buildpack heroku/python 
like image 98
CodeWizard Avatar answered Sep 29 '22 09:09

CodeWizard


There has to be a .git directory in the root of your project.

If you don't see that directory run git init and then re-associate your remote.

Like so:

heroku git:remote -a herokuAppName git push heroku master 
like image 32
CiscoKidx Avatar answered Sep 29 '22 10:09

CiscoKidx