Won't let me push to heroku - heroku

I have simple html, css and javascript and I can't seem to push to Heroku. Not sure what the problem is. Below is the error I'm getting.
Counting objects: 75, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (72/72), done.
Writing objects: 100% (75/75), 879.94 KiB | 20.46 MiB/s, done.
Total 75 (delta 33), 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 brians-rock-paper-scissors.
remote:
To https://git.heroku.com/brians-rock-paper-scissors.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/brians-rock-paper- scissors.git'
Having looked in the docs for build pack I can't seem to see anything that helps me. Any help would be appreciated.

Please follow all steps from Heroku documentation.
https://devcenter.heroku.com/start
First, choose your technology then follow it will help you.

Related

Heroku: Compiled Slug Size is too large yet my file sizes are small

I am trying to deploy my tweetbot to Heroku but thins have refused to be pushed because of this error below;
Compressing...
remote: ! Compiled slug size: 617.8M is too large (max is 500M).
remote: ! See: http://devcenter.heroku.com/articles/slug-size
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 1a2970cd3545cb60eb76f77769d6cf7c58d3c4ae
remote: !
remote: ! We have detected that you have triggered a build from source code with version 1a2970cd3545cb60eb76f77769d6cf7c58d3c4ae
remote: ! at least twice.
My files are very small so I don't know where the 617M size is coming from
What is the way forward? Thank you.

error when I push my project to heroku [remote rejected] [duplicate]

I tried to deploy my simple django project on heroku, but i couldn't understand how to solve this problem
This is the git push heroku master
remote: Traceback (most recent call last):
remote: File "/tmp/codon/tmp/buildpacks/0f40890b54a617ec2334fac0439a123c6a0c1136/vendor/runtime-fixer", line 8, in <module>
remote: r = f.read().strip()
remote: File "/usr/lib/python3.8/codecs.py", line 322, in decode
remote: (result, consumed) = self._buffer_decode(data, self.errors, final)
remote: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
remote: /tmp/codon/tmp/buildpacks/0f40890b54a617ec2334fac0439a123c6a0c1136/bin/steps/python: line 5: warning: command substitution: ignored null byte in input
remote: ) is not available for this stack (heroku-20).
remote: ! Aborting. More info: https://devcenter.heroku.com/articles/python-support
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 898dd95ff261fc77ac4dcd00edd162d7b7c054f2
remote: !
remote: ! We have detected that you have triggered a build from source code with version 898dd95ff261fc77ac4dcd00edd162d7b7c054f2
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to portfolio-project10.
remote:
To https://git.heroku.com/portfolio-project10.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/portfolio-project10.git'
C:...\portfolio-project>
It would be very nice if anyone could help me with this, or even recommending an other way to deploy django projects for free
That entire traceback is inside these parentheses: () is not available for this stack. That is the message shown when you request a Python runtime that isn't available. In this case, it looks like your runtime.txt can't even be read due to an unexpected encoding.
Delete it, then create a new file containing something like
python-3.10.2
only. Make sure it is UTF-8 encoded, commit, and redeploy.
At the moment, these are the currently supported Python versions, but the list changes as new versions are released:
python-3.10.2
python-3.9.10
python-3.8.12
python-3.7.12
I had the same issue when i was deploying my django application to Heroku. The issue is because of encoding error. Heroku is expecting the file to be saved with utf-8 but I realised that my file was saved with utf-16 le.
So if you are working in vscode then i would suggest to check the encoding for the runtime file at the bottom of vscode
If you click on utf-8 you will get the option of saving the file with different encoding .
Otherwise you can also save the file in notepad. Default encoding used by notepad is utf-8 only
That will work for sure.
Check for other files encoding also if this doesn't solve the problem
very simple
just delete the runtime.txt and push the code
this worked for me .
thankyou

Difficulties deploying Flask app to Heroku

I am trying to deploy a Flask app to Heroku and I keep getting this error. Anyone who can help me with this?
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 4 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (9/9), 3.06 KiB | 184.00 KiB/s, done.
Total 9 (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 expensetracker-api-heroku.
remote:
To https://git.heroku.com/expensetracker-api-heroku.git
! [remote rejected] secret-branchh -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/expensetracker-api-heroku.git'
Based on the UPDATED question, the error message is hinting at the problem:
No default language could be detected for this app.
You need to tell Heroku what kind of app you are deploying. For Python apps (i.e. Flask), you need to have one of the following files in your top-level git directory, as described in the Expected files for Python section of Deploying Python and Django Apps on Heroku docs:
Heroku automatically identifies your app as a Python app if any of the
following files are present in its root directory:
requirements.txt
setup.py
Pipfile
If none of these files is present in your app’s root directory, the
Python buildpack will fail to identify your application correctly.
Take note of the the warning at the end that if none of the files are present, the Python buildpack will faill.
The simplest here is to add a requirements.txt file. You can generate this by doing:
pip freeze > requirements.txt
and it looks like this:
Flask==1.0.2
Flask-Scss==0.5
gunicorn==19.7.1
isort==4.3.3
itsdangerous==0.24
Jinja2==2.10.1
...
Add that to the top-level of your git directory.
Then, for Flask, you need to add a couple more files:
runtime.txt
This specifies the Python version of your app, as described in Specifying a Python Runtime
python-3.7.3
Procfile
This is described in this post Heroku Flask Tutorial Procfile Meaning and I suggest you take a look. The contents depends on how you instantiated your Flask app instance, and it looks like this:
web: gunicorn app:app --log-file=-
If you're still having problems, I highly recommend going through the Heroku tutorial docs, especially Getting Started on Heroku with Python.

ROOT_URL is not defined | Pushing is causing a build failure

If I go to the the build log I see the following:
-----> Node.js app detected
FATAL: ROOT_URL is not defined.
! Push rejected, failed to compile Node.js app.
! Push failed
This is what I am getting in my terminal:
remote: Building source:
remote:
remote: -----> Node.js app detected
remote: FATAL: ROOT_URL is not defined.
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to virtually-viral.
remote:
To https://git.heroku.com/virtually-viral.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/virtually-viral.git'
NOTE: I do not know what to do to fix this and get my app working, I have checked multiple discussions on people having a somewhat similar problem but I was not able to fix it with their solutions.
I don't know much about Meteor so I'm not sure why this works in development, nor can I find any canonical list of critical settings that are required for it to work. The closest I can find is the documentation for Meteor.absoluteUrl (bold added):
Generate an absolute URL pointing to the application. The server reads from the ROOT_URL environment variable to determine where it is running. This is taken care of automatically for apps deployed to Galaxy, but must be provided when using meteor build.
You should be able to get past this issue by setting the ROOT_URL variable on Heroku, e.g.
heroku config:set ROOT_URL=https://virtually-viral.herokuapp.com
or through the web interface.

Run Go app on Heroku

I'm trying to follow the tutorial at https://mmcgrana.github.io/2012/09/getting-started-with-go-on-heroku. Initially everything seems to work:
ceiroa-ltm:my_heroku_app ceiroa$ heroku create -b https://github.com/kr/heroku-buildpack-go.git
Creating glacial-badlands-6720... done, stack is cedar-14
BUILDPACK_URL=https://github.com/kr/heroku-buildpack-go.git
https://glacial-badlands-6720.herokuapp.com/ | https://git.heroku.com/glacial-badlands-6720.git
Git remote heroku added
ceiroa-ltm:my_heroku_app ceiroa$ git push heroku master
Counting objects: 10, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (10/10), 925 bytes | 0 bytes/s, done.
Total 10 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching custom git buildpack... done
remote: -----> Go app detected
remote: -----> Installing go1.3.3... done
remote: -----> Running: godep go install -tags heroku ./...
remote: -----> Discovering process types
remote:
remote: -----> Compressing... done, 1.5MB
remote: -----> Launching... done, v4
remote: https://glacial-badlands-6720.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/glacial-badlands-6720.git
* [new branch] master -> master
However, no dynos are spinned:
ceiroa-ltm:my_heroku_app ceiroa$ heroku ps
ceiroa-ltm:my_heroku_app ceiroa$
And the app gives an error:
What am I doing wrong?
I tried a bunch of things that didn't work:
downgrade go version (to match the one defined in https://github.com/kr/go-heroku-example/blob/master/Godeps/Godeps.json)
move from default Eclipse Go structure to one without src, bin, or pkg inside project
use hyphens instead of underscores (for project name and in Procfile and Godeps.json)
define full identifier in Godeps.json
At the end and started from scratch again, creating the project from the command line instead of from Eclipse, and this worked.
From the things above, I can rule out #1 and #4 as fixes, as I'm back to using the same config I initially had.
Another thing that was throwing me off was references to ".godir" in different websites and posts. I don't know what this file used to be used for, but it doesn't seem necessary any more.
I'm going to point to Eclipse and its Go plugin as the culprits, for now.
Heroku now officially supports Go and has a Getting Started guide.

Resources