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!
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 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.
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.
Would appreciate any insight into how to get my Rails 2.3.8 deployed using Heroku. I am getting the following error message when I try to push to push to heroku:
git push heroku master
Enter passphrase:
Counting objects:3, done.
Compressing objects: 100 % (2/2), done.
Writing onject: 100 % (3/3), 4.34 KiB, done.
Total 3 (delta 0), reused 0 (delta 0)
-----> Heroku receiving push
Heroku push rejected, no Cedar-supported app detected
To git#heroku.com: falling-sunrise.git
[remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:falling-sunrise.git'
I have also attached the actual screenshot of my command line screen. I read somewhere that I may have to write a gemfile to get the push to work. I also did that and added it to the root of my app but no luck.
Can you provide the layout of your app? Make sure to run bundle install locally and to check your Gemfile; it may not be configured correctly, or you haven't added it the new files (including the ever-important Gemfile.lock) to git.
Also see https://devcenter.heroku.com/articles/ruby-support#rails_2x_applications
try bundling your gemfile and making sure it's complete. If that doesn't work, you might try pushing your app to a bamboo stack:
https://devcenter.heroku.com/articles/bamboo
I can't push to Heroku and unfortunately none of the other questions on StackOverflow help.
I'm using Rails 3.0.9 and Heroku doesn't recognize my app as a Rails app.
$ git push heroku master
Counting objects: 378, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (311/311), done.
Writing objects: 100% (378/378), 134.64 KiB, done.
Total 378 (delta 143), reused 107 (delta 12)
-----> Heroku receiving push
-----> Removing .DS_Store files
! Heroku push rejected due to an unrecognized error.
! We've been notified, see http://support.heroku.com if the problem persists.
To git#heroku.com:cold-xyz.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:cold-xyz.git'
The repository's layout was wrong.
My rails app was in a subdirectory of the repository. I set Rails' root directory to the repositories root directory and that fixed it:
git mv subdirectory/* .
Try updating your bundle, and then pushing it again.
Or may have something to do with gemlock file?
Else if all fails, you can remove the .git file and re init again.