Can't push to the heroku

GitScalaHerokuIntellij Idea

Git Problem Overview


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'

Git Solutions


Solution 1 - Git

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

Solution 2 - Git

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

Solution 3 - Git

If you are a python user -
Create a requirements.txt file preferably using pip freeze > requirements.txt.
Add, commit and try pushing it again.

If this doesn't work try deleting .git (beware this might remove the associated git history) and follow the above steps again.

Worked for me.

Solution 4 - Git

Make sure you have package.json inside root of your project. Happy coding :)

Solution 5 - Git

If your app is a Scala app, it must have a build.sbt in the root directory, and that file must be checked into Git. You can confirm this by running:

$ git ls-files build.sbt

If that file exists and is checked into Git, try running this command:

$ heroku buildpacks:set heroku/scala

Solution 6 - Git

Specify the buildpack while creating the app.

heroku create appname --buildpack heroku/python

Solution 7 - Git

You could also select webpack build manually from the UI enter image description here

Solution 8 - Git

You need to follow the instructions displayed here, on your case follow scala configuration:

https://devcenter.heroku.com/articles/getting-started-with-scala#introduction

After setting up the getting started pack, tweak around the default config and apply to your local repository. It should work, just like mine using NodeJS.

HTH! :)

Solution 9 - Git

If you are using django app to deploy on heroku

make sure to put request library in the requirements.txt file.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Question이국화View Question on Stackoverflow
Solution 1 - GitCodeWizardView Answer on Stackoverflow
Solution 2 - GitCiscoKidxView Answer on Stackoverflow
Solution 3 - GitmarkroxorView Answer on Stackoverflow
Solution 4 - GitgeekbroView Answer on Stackoverflow
Solution 5 - GitcodefingerView Answer on Stackoverflow
Solution 6 - GitVikas SharmaView Answer on Stackoverflow
Solution 7 - GitChaitanyaBhattView Answer on Stackoverflow
Solution 8 - GitiQhryView Answer on Stackoverflow
Solution 9 - GitMohsin MahmoodView Answer on Stackoverflow