I have a Rails 5 app that I'm trying to push to Heroku. The Heroku instance exists, git remotes are set up, etc. However I'm getting an error that it can't detect the buildpack, although it is defined. Any ideas?
$ heroku buildpacks
=== xx Buildpack URL
heroku/ruby
$ heroku buildpacks:set heroku/ruby
▸ The buildpack heroku/ruby is already set on your app.
$ git push heroku master
Counting objects: 1208, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (1075/1075), done.
Writing objects: 100% (1208/1208), 25.04 MiB | 1.63 MiB/s, done.
Total 1208 (delta 634), reused 217 (delta 49)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Failed to detect set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/ruby.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to xx.
...
If the configured buildpack cannot handle your application (as determined by its detection script), you will receive an error. For example, Heroku’s Ruby buildpack expects a Gemfile to be present in the root folder of an application to correctly identify its type, but if the buildpack of an application is set to heroku/ruby and no Gemfile is present, the application will fail to build. Try check if your Gemfile is present in the root folder of your project.
Related
I'm attempting to deploy my Ruby on Rails application that is currently on branch "rails_app" (as shown below). I have successfully deployed it before, but it is now not working with additional changes. When I manually look for buildpacks by running "heroku buildpacks," it indicates the correct one is there. [When I try to reinstall the buildpack, it also says it is already there] When I attempt to push to heroku I receive the failure to detect set buildpath as shown below.
Dougs-MBP-2:Rails_Application Doug$ heroku buildpacks
app_name Buildpack URL
heroku/ruby
Dougs-MBP-2:Rails_Application Doug$ git branch
gh-pages
master
* rails_app
update
Dougs-MBP-2:Rails_Application Doug$ git push heroku rails_app:master
Counting objects: 70, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (70/70), done.
Writing objects: 100% (70/70), 217.85 KiB | 0 bytes/s, done.
Total 70 (delta 46), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Failed to detect set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/ruby.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to app_name.
remote:
To https://git.heroku.com/app_name.git
! [remote rejected] rails_app -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/app_name.git'
Thanks for your help.
It seems you are setting a custom buildpack: "https://codonbuildpacks.s3.amazonaws.com/buildpacks/heroku/ruby.tgz" but when I visit that link it says that no bucket with that name exists which means that heroku can't detect your custom buildpack and fails.
You can read more about how to specify custom buildpacks here: https://devcenter.heroku.com/articles/buildpacks#detection-failure
The ruby buildpack that heroku uses is on this page:
https://elements.heroku.com/buildpacks/heroku/heroku-buildpack-ruby
I am trying to push some ruby code with git and keep getting stopped part way through. Here is my setup and error I get..
root#slacker:~/ruby# git remote -v
heroku https://git.heroku.com/warm-woodland-27175.git (fetch)
heroku https://git.heroku.com/warm-woodland-27175.git (push)
root#slacker:~/ruby# ls
config.ru myapp.rb
root#slacker:~/ruby# git push heroku master
Counting objects: 4, done.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 398 bytes | 0 bytes/s, done.
Total 4 (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 warm-woodland-27175.
remote:
To https://git.heroku.com/warm-woodland-27175.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/warm-woodland- 27175.git'
root#slacker:~/ruby#
I am still trying to understand the ins and outs of git but I am pretty lost as to why git doesn't recognize the file extensions in my compilation folder. I thought that was how it fetched what language to use, .rb .pl etc... Any help would be much appreciated.
I had this error when trying to deploy my Sinatra app to Heroku.
heroku buildpacks:set heroku/ruby
I read https://devcenter.heroku.com/articles/buildpacks which helped me finish the solution.
But I started with https://devcenter.heroku.com/articles/rack
which helped me understand the files that you need to add such as the Gemfile etc. Make sure you do the bundle install.
Make sure you committed your changes after you added the Gemfile, etc. So
git add .
or whatever you need to do it then commit
git commit -m "Added files for Heroku deployment"
or change the message as you want. and then can you deploy using
git push heroku master
Now I have my site running using heroku
If I am missing something that you need, just ask in comments so I can clarify.
I had the same issue when I was trying to deploy to Heroku with Ruby Sinatra. The issue in my case was that I'm brand new to Ruby and Sinatra and didn't know anything about the gems and bundling.
I literally only had my app.rb file in the folder.
I took the following steps, based on some guides 1 I read:
If my app is called app.rb, create a file called config.ru:
require './hello'
run Sinatra::Application
Create a file called Gemfile:
source 'https://rubygems.org'
gem 'sinatra'
Then I found this article that reminded me that I need to run bundle install.
Then I add these files to my git, pushed it, and mine is working!
Recently I tried to push my Rails project to git using Heroku, but the wild problem appeard.
All lines I pasted here: http://pastebin.com/5y09wFCi
Here I paste lines, which I found most important:
$ git push heroku master
Initializing repository, done.
Counting objects: 98, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (89/89), done.
Writing objects: 100% (98/98), 20.04 KiB | 0 bytes/s, done.
Total 98 (delta 8), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using 1.7.12
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Fetching gem metadata from https://rubygems.org/...........
.
.
.
Bundle completed (26.03s)
Cleaning up the bundler cache.
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
I, [2015-02-07T17:06:17.823271 #1283] INFO -- : Writing /tmp/build_374afebb598e92eacd894ae2e50e6a4d/public/assets/application-4be62d87c5bb7f3e09992032049b2bd0.js
rake aborted!
wrong number of arguments (2 for 1)
.
.
.
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app
To git#heroku.com:stark-tor-4197.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:stark-tor-4197.git'
stark-tor-4197 is my randomly named project.
It may be also important - I read, that Heroku don't work with sqlite3, so I had to make change in my gemfile.
Now part about database looks like this:
http://pastebin.com/EKjFzKDh
# Use postgresql as the database for Active Record
gem 'pg'
gem 'rails_12factor', group: :production
Thanks for any help!
A while ago I also had this problem where the following happened:
git push github master
To git#github.com:Joey-project/project.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git#github.com:Joey-project/project.git'
I've been told that the most common reason of this happening is because one is trying to push a branch to a remote branch that has been updated in the meantime.
In general one has to use a variation of the following commands:
git fetch github; git merge github/master
Any chance you already looked at RomanKapitonov's question (heroku: Gemfile.lock is required issue)? I believe it's related to your issue.
Try to run rake assets:precompile on your local as it looks like there is some error in your assets i.e. javascript or css files.
I am attempting to push a Rails app to Heroku however I am constantly getting this error.
user$ git push heroku master
Initializing repository, done.
Counting objects: 158, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (144/144), done.
Writing objects: 100% (158/158), 671.52 KiB | 160.00 KiB/s, done.
Total 158 (delta 32), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby/Rails
!
! An error occurred while installing Ruby ruby-2.1.1
! For supported Ruby versions see https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
! Note: Only the most recent version of Ruby 2.1 is supported on Cedar-14
! Command: 'set -o pipefail; curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/cedar-14/ruby-2.1.1.tgz -s -o - | tar zxf - ' failed unexpectedly:
!
! gzip: stdin: unexpected end of file
! tar: Child returned status 1
! tar: Error is not recoverable: exiting now
!
! Push rejected, failed to compile Ruby app
To git#heroku.com:user.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:user.git'
I have research some possible solutions hover around on S.O however none of which seemed to work. I tried destroying the heroku app then recreating it and I tried using different ruby versions but that didnt seem to work either.
Heroku does not support version 2.1.1
https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
You need to specify a different version in your Gemfile:
# Gemfile
source "https://rubygems.org"
ruby '2.1.4' # or other from link above
[...]
I'm getting an "Incompatible minimum and maximum heap sizes specified" compiler error trying to push a Grails application to Heroku. I don't know of a way to enable more verbose logging during compilation but I'd be happy to provide more info.
506 ita-signup $ git push heroku master
Counting objects: 31, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (19/19), done.
Writing objects: 100% (21/21), 2.74 KiB, done.
Total 21 (delta 11), reused 0 (delta 0)
-----> Heroku receiving push
-----> Removing .DS_Store files
-----> Grails app detected
-----> Grails 2.0.4 app detected
WARNING: The Grails buildpack is currently in Beta.
-----> Executing grails -Divy.default.ivy.user.dir=/app/tmp/repo.git/.cache compile --non-interactive
Error occurred during initialization of VM
Incompatible minimum and maximum heap sizes specified
! Failed to build app
! Heroku push rejected, failed to compile Grails app
To git#heroku.com:XXX-3359.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:XXX-3359.git'
Answer: I had set the user-env-compile feature. Using this to force valid heap settings worked:
$ heroku config:set JAVA_OPTS='-Xms384m -Xmx384m -Xss512k -XX:+UseCompressedOops'
$ git push heroku master
...
(success)