[git] 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:  !     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:  !     Push failed
remote: Verifying deploy....
remote: !   Push rejected to salty-coast-14102.
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'

This question is related to git scala heroku intellij-idea

The answer is

Read this doc which will explain to you what to do.

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

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

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.

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

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

Specify the buildpack while creating the app.

heroku create appname --buildpack heroku/python

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

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


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! :)

If you are using django app to deploy on heroku

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

Questions with git tag:

Does the target directory for a git clone have to match the repo name? Git fatal: protocol 'https' is not supported Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) git clone: Authentication failed for <URL> destination path already exists and is not an empty directory SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 GitLab remote: HTTP Basic: Access denied and fatal Authentication How can I switch to another branch in git? VS 2017 Git Local Commit DB.lock error on every commit How to remove an unpushed outgoing commit in Visual Studio? How to know the git username and email saved during configuration? How to add a new project to Github using VS Code git clone error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054 fatal: ambiguous argument 'origin': unknown revision or path not in the working tree HTTP Basic: Access denied fatal: Authentication failed npm notice created a lockfile as package-lock.json. You should commit this file Do I commit the package-lock.json file created by npm 5? Abort a Git Merge key_load_public: invalid format git - remote add origin vs remote set-url origin Visual Studio 2017 - Git failed with a fatal error Get git branch name in Jenkins Pipeline/Jenkinsfile Changing the git user inside Visual Studio Code How to compare different branches in Visual Studio Code Git checkout - switching back to HEAD Clear git local cache Deleting a local branch with Git Rebuild Docker container on file changes Cloning specific branch How to add chmod permissions to file in Git? Git copy changes from one branch to another Git merge with force overwrite Project vs Repository in GitHub How to add a file to the last commit in git? Getting permission denied (public key) on gitlab Delete commit on gitlab gpg failed to sign the data fatal: failed to write commit object [Git 2.10.0] Remove a modified file from pull request Updates were rejected because the tip of your current branch is behind its remote counterpart Can't push to the heroku How to discard local changes and pull latest from GitHub repository In Visual Studio Code How do I merge between two local branches? error: RPC failed; curl transfer closed with outstanding read data remaining Change drive in git bash for windows Checkout Jenkins Pipeline Git SCM with credentials? How to fix git error: RPC failed; curl 56 GnuTLS Trying to pull files from my Github repository: "refusing to merge unrelated histories" Visual Studio Code how to resolve merge conflicts with git? merge one local branch into another local branch Can't push to remote branch, cannot be resolved to branch

Questions with scala tag:

Intermediate language used in scalac? Why does calling sumr on a stream with 50 tuples not complete Select Specific Columns from Spark DataFrame Joining Spark dataframes on the key Provide schema while reading csv file as a dataframe how to filter out a null value from spark dataframe Fetching distinct values on a column using Spark DataFrame Can't push to the heroku Spark - Error "A master URL must be set in your configuration" when submitting an app Add jars to a Spark Job - spark-submit How to sum the values of one column of a dataframe in spark/scala How to create a DataFrame from a text file in Spark Filter spark DataFrame on string contains java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries. spark Eclipse on windows 7 Renaming column names of a DataFrame in Spark Scala Spark: Add column to dataframe conditionally Is there a way to take the first 1000 rows of a Spark Dataframe? How to select the first row of each group? How to save a spark DataFrame as csv on disk? dataframe: how to groupBy/count then filter on count in Scala Extract column values of Dataframe as List in Apache Spark Write single CSV file using spark-csv How to create an empty DataFrame with a specified schema? How do I check for equality using Spark Dataframe without SQL Query? How to define partitioning of DataFrame? Spark read file from S3 using sc.textFile ("s3n://...) How to save DataFrame directly to Hive? How to sort by column in descending order in Spark SQL? Spark - load CSV file as DataFrame? How to convert rdd object to dataframe in spark How can I change column types in Spark SQL's DataFrame? How do I skip a header from CSV files in Spark? Spark : how to run spark file from spark shell How to read files from resources folder in Scala? How to load local file in sc.textFile, instead of HDFS How to turn off INFO logging in Spark? Exception: Unexpected end of ZLIB input stream How do I convert csv file to rdd Print the data in ResultSet along with column names How to print the contents of RDD? Task not serializable: java.io.NotSerializableException when calling function outside closure only on classes not objects Apache Spark: map vs mapPartitions? Add element to a list In Scala I want to get the type of a variable at runtime Scala check if element is present in a list Install sbt on ubuntu Scala: join an iterable of strings Return in Scala Scala how can I count the number of occurrences in a list ScalaTest in sbt: is there a way to run a single test without tags?

Questions with heroku tag:

How to fix error "ERROR: Command errored out with exit status 1: python." when trying to install django-heroku using pip Can't push to the heroku ImproperlyConfigured: You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings How to enable CORS in flask Error: Cannot pull with rebase: You have unstaged changes How to solve error "Missing `secret_key_base` for 'production' environment" (Rails 4.1) Failed to execute 'postMessage' on 'DOMWindow': The target origin provided does not match the recipient window's origin ('null') 'heroku' does not appear to be a git repository Heroku 'Permission denied (publickey) fatal: Could not read from remote repository' woes How do I set up DNS for an apex domain (no www) pointing to a Heroku app? Heroku + node.js error (Web process failed to bind to $PORT within 60 seconds of launch) npm ERR cb() never called Rails: How to reference images in CSS within Rails 4 How to restart a rails server on Heroku? First Heroku deploy failed `error code=H10` Heroku deployment error H10 (App crashed) Heroku "psql: FATAL: remaining connection slots are reserved for non-replication superuser connections" Should I check in folder "node_modules" to Git when creating a Node.js app on Heroku? Why do people use Heroku when AWS is present? What distinguishes Heroku from AWS? failed to push some refs to [email protected] setting an environment variable in virtualenv How to configure heroku application DNS to Godaddy Domain? How to change a Git remote on Heroku Easy way to prevent Heroku idling? How to link a folder with an existing Heroku app How to empty a Heroku database Permission denied (publickey) when deploying heroku code. fatal: The remote end hung up unexpectedly Heroku: How to push different local Git branches to Heroku/master How to stop an app on Heroku? heroku - how to see all the logs

Questions with intellij-idea tag:

IntelliJ: Error:java: error: release version 5 not supported Has been compiled by a more recent version of the Java Runtime (class file version 57.0) Error: Java: invalid target release: 11 - IntelliJ IDEA IntelliJ can't recognize JavaFX 11 with OpenJDK 11 Error: JavaFX runtime components are missing, and are required to run this application with JDK 11 ERROR Source option 1.5 is no longer supported. Use 1.6 or later Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6 How to configure "Shorten command line" method for whole project in IntelliJ intellij idea - Error: java: invalid source release 1.9 Failed to resolve: com.google.android.gms:play-services in IntelliJ Idea with gradle Gradle - Could not target platform: 'Java SE 8' using tool chain: 'JDK 7 (1.7)' JAVA_HOME should point to a JDK not a JRE Class JavaLaunchHelper is implemented in two places How do I activate a Spring Boot profile when running from IntelliJ? Class Not Found: Empty Test Suite in IntelliJ System.out.println() shortcut on Intellij IDEA Can't push to the heroku Error: Module not specified (IntelliJ IDEA) IntelliJ cannot find any declarations Re-run Spring Boot Configuration Annotation Processor to update generated metadata Kotlin unresolved reference in IntelliJ Android Gradle Apache HttpClient does not exist? Intellij Idea: Importing Gradle project - getting JAVA_HOME not defined yet Any way (or shortcut) to auto import the classes in IntelliJ IDEA like in Eclipse? Intellij JAVA_HOME variable Unable to run Java code with Intellij IDEA What are .iml files in Android Studio? How to: Install Plugin in Android Studio Where to put the gradle.properties file Error: Unfortunately you can't have non-Gradle Java modules and > Android-Gradle modules in one project How to install Intellij IDEA on Ubuntu? Error:java: javacTask: source release 8 requires target release 1.8 How to delete projects in Intellij IDEA 14? Android studio Error "Unsupported Modules Detected: Compilation is not supported for following modules" How to decompile to java files intellij idea Class file has wrong version 52.0, should be 50.0 Change remote repository credentials (authentication) on Intellij IDEA 14 Git Stash vs Shelve in IntelliJ IDEA Getting Gradle dependencies in IntelliJ IDEA using Gradle build git with IntelliJ IDEA: Could not read from remote repository Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-2.1-all.zip' cannot resolve symbol javafx.application in IntelliJ Idea IDE Intellij Cannot resolve symbol on import intellij incorrectly saying no beans of type found for autowired repository Best way to add Gradle support to IntelliJ Project How do I remove my IntelliJ license in 2019.3? How can I analyze a heap dump in IntelliJ? (memory leak) Package name does not correspond to the file path - IntelliJ Unable to open debugger port in IntelliJ IDEA .ssh/config file for windows (git)