I have seen many question on Stackoverflow a bit similar to my question but none have faced same problem which I am having while I try to push my app to heroku.
My Ruby On Rails app is created on rails 3.2.17 and ruby v. 1.9.3 and currently it is in local setup I want to push it to heroku server.. but always I keep getting the same error, this is the full response which I am getting in 'git Bash prompt'
$ git push heroku master
Initializing repository, done.
Counting objects: 1708, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1640/1640), done.
Writing objects: 100% (1708/1708), 47.02 MiB | 150.00 KiB/s, done.
Total 1708 (delta 207), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-1.9.3
-----> Warning:
Removing `Gemfile.lock` because it was generated on Windows
Bundler will do a full resolve so native gems are handled p
This may result in unexpected gem versions being used in yo
In rare occasions Bundler may not be able to resolve your d
all.
https://devcenter.heroku.com/articles/bundler-windows-gemfi
-----> Installing dependencies using 1.5.2
Running: bundle install --without development:test --path v
-binstubs vendor/bundle/bin -j4
Fetching git://github.com/gregbell/active_admin.git
Fetching source index from http://ruby.taobao.org/
Resolving dependencies.....................................
Network error while fetching
http://rubygems-china.oss.aliyuncs.com/quick/Marshal.4.8/tr
emspec.rz
Bundler Output: Fetching git://github.com/gregbell/active_a
Fetching source index from http://ruby.taobao.org/
Resolving dependencies.....................................
Network error while fetching
http://rubygems-china.oss.aliyuncs.com/quick/Marshal.4.8/tr
emspec.rz
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app
To git#heroku.com:myapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:myapp.git'
I have solved it by myself, actually in my Gemfile source was set as 'http://ruby.taobao.org' and i guess there was some kind of network conflict between http://ruby.taobao.org and heroku server during the process of installing gems. I changed the source to 'http://rubygems.org' and it worked.
Related
I need some help with this small app I am trying to push to heroku after doing
git add .
git commit -m "message here"
git push heroku master
I get the following error message:
Enumerating objects: 174, done.
Counting objects: 100% (174/174), done.
Delta compression using up to 12 threads
Compressing objects: 100% (156/156), done.
Writing objects: 100% (174/174), 38.41 KiB | 2.40 MiB/s, done.
Total 174 (delta 62), reused 36 (delta 3)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.3.10
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.6.6
remote: -----> Installing dependencies using bundler 2.3.10
remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote: /usr/bin/env: ‘ruby\r’: No such file or directory
remote: Bundler Output: /usr/bin/env: ‘ruby\r’: No such file or directory
remote:
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to damp-spire-06287.
remote:
To https://git.heroku.com/damp-spire-06287.git
! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/damp-spire-06287.git
I am not sure if it is an issue with the bundler version or something else but I need any help if possible. I have tried doing
bundle install and bundle update
and the bundle completes without a hitch. I have been stuck for a while and tried replacing the bundle version to no avail. Thanks in advance!
This error is caused because you have incorrect line endings (CRLF vs. LF) in your repo, which is generally caused when you are working/deploying across Windows and Unix-like environments. Mac/Unix/Linux environments -- which Heroku uses -- use a single linefeed (usually denoted \n) character to terminate a line while Windows uses a carriage return/linefeed pair (\r\n).
If your local repo is on a Windows machine you'll need to convert the files in your repo before pushing to Heroku. You can configure Git to handle the auto-conversion so that you have Windows terminators when you checkout on Windows but maintain the repo with just linefeeds.
To set up the automatic conversion:
% git config --global core.autocrlf input
Git also provides a way to refresh your repo to ensure all the line endings are correct. This can cause merge headaches since this can affect every line in some/all files, so you preferably want to do this on a fully up-to-date repo (i.e., no un-pushed changes).
% git add --renormalize .
% git commit -m "Normalize all the line endings"
https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
rakesh#rakesh:~/rails/sapwii$ git push heroku master
Fetching repository, done.
Counting objects: 29, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (19/19), done.
Writing objects: 100% (19/19), 58.09 KiB, done.
Total 19 (delta 15), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using 1.6.3
Ruby version change detected. Clearing bundler cache.
Old: ruby 2.0.0p481 (2014-05-08 revision 45883) [x86_64-linux]
New: ruby 2.0.0p576 (2014-09-19 revision 47628) [x86_64-linux]
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Fetching gem metadata from https://rubygems.org/........
Could not find activemerchant-1.43.2 in any of the sources
Bundler Output: Fetching gem metadata from https://rubygems.org/........
Could not find activemerchant-1.43.2 in any of the sources
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app
To git#heroku.com:sapwii.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:sapwii.git'
I tried changing the SSH Keys and on heroku, getting this error only when pushing my core repository is fine to commit and clone
From the error above, the error is caused by the active merchant version. If you look at the list of available versions for active merchant, you'll see that version 1.43.2 is not there. So either you upgrade or downgrade the version. Check out your Gemfile and make sure that the version activemerchant is locked to exists.
If you didn't lock the activemerchant version in your Gemfile, just run bundle update activemerchant and that will fix your issue.
Heroku fails pushing is caused by the following gem in Gemfile :
gem 'mongoid_taggable_with_context', :git => 'git#github.com:lgs/mongoid_taggable_with_context.git'
lsoave#ubuntu:~/rails/github/gitwatcher$ git push heroku +master
Counting objects: 233, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (196/196), done.
Writing objects: 100% (199/199), 286.76 KiB | 62 KiB/s, done.
Total 199 (delta 160), reused 2 (delta 2)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-1.9.3
-----> Installing dependencies using Bundler version 1.2.0.rc
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://rubygems.org/..
Updating git://github.com/rweng/jquery-datatables-rails.git
Fetching git#github.com:lgs/mongoid_taggable_with_context.git
Host key verification failed.
fatal: The remote end hung up unexpectedly
Git error: command `git clone 'git#github.com:lgs/mongoid_taggable_with_context.git' "/tmp/build_1mck6mlqu6pko/vendor/bundle/ruby/1.9.1/cache/bundler/git/mongoid_taggable_with_context-cf14763a075f5ec09e40c360c8537afb67040db7" --bare --no-hardlinks` in directory /tmp/build_1mck6mlqu6pko has failed.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
To git#heroku.com:gitwatcher.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:gitwatcher.git'
lsoave#ubuntu:~/rails/github/gitwatcher$
Tried this?
gem 'mongoid_taggable_with_context', :git => 'git://github.com/lgs/mongoid_taggable_with_context.git'
I had encountered this error when attempting to push a spree sandbox cart to test an extension I was going to use.
My Gemfile
gem 'spree_flexi_variants', :git=>'git#github.com:jsqu99/spree_flexi_variants.git', :branch => 'pre-deface-stable'
The output of heroku push:
julio#ubuntu:~/rails/sandboxcart $ git push heroku master
Counting objects: 502, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (475/475), done.
Writing objects: 100% (502/502), 2.63 MiB | 458 KiB/s, done.
Total 502 (delta 44), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Detected Rails is not set to serve static_assets
Installing rails3_serve_static_assets... done
-----> Configure Rails 3 to disable x-sendfile
Installing rails3_disable_x_sendfile... done
-----> Configure Rails to log to stdout
Installing rails_log_stdout... done
-----> Gemfile detected, running Bundler version 1.0.7
Unresolved dependencies detected; Installing...
Using --without development:test
Fetching source index for http://rubygems.org/
Fetching git#github.com:jsqu99/spree_flexi_variants.git
Failed to add the host to the list of known hosts (/home/group_home/.ssh/known_hosts).
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
An error has occurred in git when running `git clone "git#github.com:jsqu99/spree_flexi_variants.git" "/disk1/tmp/build_1s7xejrz2f9xk/.bundle/gems/ruby/1.9.1/cache/bundler/git/spree_flexi_variants-fc5500c20fdd64421924c0c5673538c7c6822540" --bare --no-hardlinks`. Cannot complete bundling.
FAILED: http://devcenter.heroku.com/articles/bundler
! Heroku push rejected, failed to install gems via Bundler
The app runs and uses the gem properly but upon trying to deploy that error occurs. I am still in the process of trouble shooting but any help would be appreciated.
Do the following change:
gem 'spree_flexi_variants', :git=>'git#github.com:jsqu99/spree_flexi_variants.git', :branch => 'pre-deface-stable'
TO
gem 'spree_flexi_variants', :git=>"git://github.com/jsqu99/spree_flexi_variants.git", :branch => 'pre-deface-stable'
That should do it, and it has nothing to do with your heroku keys.
This looks like a problem with your SSH keys.
The Heroku Site has instructions on how to manage SSH keys.
Try heroku keys and make sure that you have configured that properly.
I am following the guide on railstutorial.org. I get this error when I type the command on the title.
Counting objects: 66, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (52/52), done.
Writing objects: 100% (66/66), 86.47 KiB, done.
Total 66 (delta 3), reused 0 (delta 0)
-----> Heroku receiving push
-----> Rails app detected
-----> Detected Rails is not set to serve static_assets
Installing rails3_serve_static_assets... done
-----> Gemfile detected, running Bundler version 1.0.0
Unresolved dependencies detected; Installing...
You have modified your Gemfile in development but did not check
the resulting snapshot (Gemfile.lock) into version control
You have added to the Gemfile:
* sqlite3-ruby (= 1.3.7)
You have deleted from the Gemfile:
* sqlite3-ruby (= 1.2.5)
FAILED: http://docs.heroku.com/bundler
! Heroku push rejected, failed to install gems via Bundler
error: hooks/pre-receive exited with error code 1
To git#heroku.com:morning-mountain-34.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:morning-mountain-34.git'
then when i type:
$ heroku open
I get a mountain site:http://morning-mountain-34.heroku.com/ which isn't supposed to be the case: should be first_app
found the solution:
first the problem occured possibly because of the so many mistakes I made earlier that I kept on closing the terminal.
so things were probably disabled. like "git init" "git add ." and "git commit -m" I don't really know which one but after doing all those and typing: git push heroku master.
It finally went through and when I type: heroku open. it still opens to morning-mountain-34 but it contains my first app now (which is nothing but its the one on the guide too :))