Heroku "Push rejected, failed to detect set buildpack heroku/ruby" - ruby

So i'm trying to push my work (Sinatra) to Heroku but keep getting the error "Push rejected, failed to detect set buildpack heroku/ruby"
Suggestions?

Facepalm It seems like we have a rubberduck situation over here... kinda. Since I forgot to add a Gemfile. -.-'

You should also make sure you're on the master branch or that you have have your Gemfile and package.json on your master branch when you push. I had the same error using a heroku/python buildpack but I was not on the master branch. My master branch did not have a Procfile on there, so even though I saw a Procfile, heroku did not.

Related

Error when Yeoman app deployed to Heroku

I get the following error after deploying my Yeoman app to Heroku
GET http://myapp.herokuapp.com/favicon.ico 503 (Service Unavailable)
I have a favicon image, and everything runs fine locally with the favicon image appearing. I'm not sure how to fix this error or why it is being caused in the first place.
Here is all my code: https://github.com/dkretsch12/MyHerokuApp
And I push it to Heroku with the following commands:
git add .
git commit -am "still stuck"
git push heroku master
I also ran into this, and for me it turned out the '503 (Service Unavailable)' error was not the real error.
Try:
heroku logs --app [your-app-name]
and see if it gives you more info.
In my case it was that Heroku was looking for npm start script, which I had not specified, but is required by Heroku.
Looking at your package.json I see you don't have it either, so that might be the place to start.
edit
I think the underlying reason for this error is that by default Heroku expects a webserver or some kind executable to be running in the background. It's needed because otherwise incoming requests would not be handled. So it has to be provided by the programmer, and after installation Heroku will run it, either by npm start or by what is specified in the Procfile.
I my case I needed a webserver anyway, so I just created a server.js module where I implemented a small express app. Then in package.json I specified:
"scripts": {
"start": "node server.js",
...
},
But this may not be the right solution for you, it depends on what you want with your app. I don't know anything about Grunt or Angular, so I can't help you there. I did find this question which may be of value to you. I also recommend reading the docs on Heroku Dev Center
I had the same 503 service unavailable error favicon.ico, when attempting to open a Heroku deployed Rails/React app. I was stuck on this bug for at least an hour, and thought this post may provide insight on how I solved the 503 favicon issue.
Step 1: I tried to locate a favicon.ico file in my rails app, tried creating my own favicon.ico file, and placing said file in the root and other directories. I got the same error...
Step 2. I ran the following in terminal: heroku logs -t, scrolled up and found the actual error to be Heroku failing to support gem sqlite3.
An error occurred while installing sqlite3 (1.3.13), and Bundler cannot
remote: continue.
remote: Make sure that `gem install sqlite3 -v '1.3.13'` succeeds before bundling.
remote:
remote: In Gemfile:
remote: sqlite3
remote: !
remote: ! Failed to install gems via Bundler.
remote: ! Detected sqlite3 gem which is not supported on Heroku:
remote: ! https://devcenter.heroku.com/articles/sqlite3
More info as to why is here.
Step 3: After learning more, I discovered I can either follow the heroku documentation to figure out how to use sqlite3 with heroku, or change DB. I chose to change DB to postgres, and I found two amazing resources to help with that:
how to change your rails app database from sqlite to postgresql before deploying to heroku.
Change from SQLite to PostgreSQL in a fresh Rails project
Step 4: After doing so, I got a 500 internal server error, went to heroku logs -t again, and found out that my tables did not exist on heroku. From there, I knew I had to migrate rails DB to heroku using the following command: heroku run bundle exec rails:db migrate. Pushed to heroku and that did the trick.
TLDR: A status 503 unable to find path="/favicon.ico" doesn't necessarily mean the issue stems from a missing favicon.ico in a heroku deployed app. A more insightful method for determining root cause is to use heroku logs -t.

Install FFMPEG on Heroku

I am trying to install FFMPEG to work with my NodeJs server.
I am using heroku-buildpack-multi plugin:
heroku config:set BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git
I have created a .buildpacks (without extesion) file at my github repository. This is what it includes:
https://github.com/jayzes/heroku-buildpack-ffmpeg
https://github.com/heroku/heroku-buildpack-nodej
Each time i am trying to push my changes to heroku, this is what i get:
-----> Fetching custom git buildpack... failed
! Push rejected, error fetching custom buildpack
Unforlunatly, there is not much information regarding ffmpeg installtion
on heroku. What am i missing here?
I just tried this with a demo app I cloned from Heroku:
https://github.com/heroku/node-js-getting-started.git
I was able to deploy successfully following the same steps you listed above, except I added an 's' to the end of your second buildpack (you have a typo - could this be the issue?): https://github.com/heroku/heroku-buildpack-nodejs
I would recommend following the same process with a fresh codebase to help troubleshoot your environment. But note two things: 1) The heroku-buildpack-multi plugin you're using is deprecated, and 2) Heroku officially supports multiple buildpacks:
https://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app
and has an officially supported ffmpeg buidback you can use:
https://elements.heroku.com/buildpacks/jonathanong/heroku-buildpack-ffmpeg-latest

Pod push fails to push to master repo

I am trying to release a podspec on Cocoapods. According to the documentation, I should be able to use pod spec create [NAME] followed by rake release to release the podspec. Everything seems to go fine until rake release tries to push to the Specs repo.
Adding the spec to the `master' repo
$ /opt/local/bin/git status --porcelain 2>&1
- [No change] IPQuickModal (0.1.2)
Pushing the `master' repo
Username for 'https://github.com': brightredchilli
Password for 'https://brightredchilli#github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/CocoaPods/Specs.git/'
It looks like it is trying to push to the main Cocoapods Spec repo, which will make sense as to why it fails. Am I missing something? It looks like the tool is easy to use, but I need push access to the spec repo. However, this is not clear on the doc page.
To submit a podspec to CocoaPods (currently) you must submit a pull request to the specs repo. Currently no one but the core team has push access.

rake gen_deploy rejected in Octopress

I installed Octopress in GitHub Pages.
And I clone the repository.
$ git clone git#github.com:my-name/my-name.github.io.git
$ git checkout source
And
$ rake setup_github_pages
I input my repository name.
And
$ rake gen_deploy
I got error
! [rejected] master -> master (non-fast-forward)
my solution
I resolve this problem, in GitHub delete my-name.github.io.git, and make same name repository and
$ rake gen_deploy
But I don't want to delete repository
What is the best solution?
Without deleting the repository
Please keep in mind this is not considered best practice, but it may work for you.
The solution is to force a push on the master branch.
Edit the Rakefile and look for this line:
system "git push origin #{deploy_branch}"
Alter the line by adding a plus (+) before the #{deploy_branch} tag:
system "git push origin +#{deploy_branch}"
Run the command
rake deploy
It should succeed.
Undo the edit you made to the Rakefile!
Idea for this solution came from reading this: https://stackoverflow.com/a/9629458/1369730
I have the same problem when hosting my Octopress blog on github pages. I Googled a lot and finally solved this problem.
Just change the directory.
cd octopress/_deploy
git pull origin master
cd ..
rake deploy
Then it's fixed.

Heroku - Binary only buildack?

I'm attempting to upload a Play! 2.1 Project to Heroku, however the build keeps timing out after 15 minutes. (During the javascript minification/uglification stage).
Plan B is to simply compile it ourselves locally (play dist) and upload the resulting compiled package with a Procfile to launch it.
This fails, however, as Heroku seems intent on detecting source code and compiling it, and doesn't seem to be happy with executing a simple shell script.
Heroku push rejected, no Cedar-supported app detected
Is it possible to have heroku ignore the build process and simply execute my Procfile?
You'll have to push your zip file into a git repo, and then you'll have to use a special buildpack, and a special Procfile.
Maybe it can help : https://stackoverflow.com/a/16580332/320180

Resources