Guys I have no clue why this push to Heroku isn't working. Any ideas?
Fetching git://github.com/gregbell/active_admin.git
fatal: Could not parse object '54fb71c5415f7b1a7aa0cdde680ee882fa3b2d6f'.
Git error: command `git reset --hard 54fb71c5415f7b1a7aa0cdde680ee882fa3b2d6f`
in directory
/tmp/build_1660sx0l4npgk/vendor/bundle/ruby/2.0.0/bundler/gems/active_admin-54fb71c5415f
has failed.
If this error persists you could try removing the cache directory
'/tmp/build_1660sx0l4npgk/vendor/bundle/ruby/2.0.0/cache/bundler/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca'
Bundler Output: Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Fetching git://github.com/justinfrench/formtastic.git
Fetching git://github.com/josevalim/inherited_resources.git
Fetching git://github.com/ernie/ransack.git
Fetching git://github.com/gregbell/active_admin.git
fatal: Could not parse object '54fb71c5415f7b1a7aa0cdde680ee882fa3b2d6f'.
Git error: command `git reset --hard 54fb71c5415f7b1a7aa0cdde680ee882fa3b2d6f`
in directory
/tmp/build_1660sx0l4npgk/vendor/bundle/ruby/2.0.0/bundler/gems/active_admin-54fb71c5415f
has failed.
If this error persists you could try removing the cache directory
'/tmp/build_1660sx0l4npgk/vendor/bundle/ruby/2.0.0/cache/bundler/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca'
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby/Rails app
I had this error today and found that my Gemfile.lock file included a reference to the same commit you were using:
GIT
remote: git://github.com/gregbell/active_admin.git
revision: 54fb71c5415f7b1a7aa0cdde680ee882fa3b2d6f
branch: rails4
specs:
activeadmin (0.6.0)
...
I'm not sure why that commit is no longer available but I was able to specify one in my Gemfile using the :ref option:
gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4', ref: 'a9949c1524205928b18597f840e83478ba97c2ef'
The resulting change to Gemfile.lock:
GIT
remote: git://github.com/gregbell/active_admin.git
revision: a9949c1524205928b18597f840e83478ba97c2ef
ref: a9949c1524205928b18597f840e83478ba97c2ef
branch: rails4
specs:
activeadmin (0.6.0)
...
This feels like a safer way to control when including libraries directly from Github.
Related
I have built a simple sinatra web app on my macbook. The deployment to heroku fails with the logs below. The problem is that I've already implemented their suggested fix (bundle lock --add-platform x86_64-linux) and I still get the same error message.
Any suggestions as to next steps would be very welcome. Thanks in advance.
-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> Ruby app detected
-----> Installing bundler 2.2.33
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rack
-----> Using Ruby version: ruby-2.7.5
-----> Installing dependencies using bundler 2.2.33
Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
Your bundle only supports platforms ["arm64-darwin-20"] but your local platform
is x86_64-linux. Add the current platform to the lockfile with `bundle lock
--add-platform x86_64-linux` and try again.
Bundler Output: Your bundle only supports platforms ["arm64-darwin-20"] but your local platform
is x86_64-linux. Add the current platform to the lockfile with `bundle lock
--add-platform x86_64-linux` and try again.
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app.
! Push failed
*Update
My local repo, with x86_64-linux in Gemfile.lock, is out of sync with the remote repo on github that I have been trying to deploy from. Other files are out of date too. Concerningly, I have both pushed and pulled recently, as well as deleted the remote repo, created a new one and pushed again. Git is telling me that both the local and the remote repos are up to date with each other, when they are obviously not.
I've tried pushing directly to heroku from the command line but hit the same platform error as above.
So I am learning how to use git with Heroku and I can't seem to git push my set repo. So I set the buildpack to ruby with Heroku as ruby by doing so..
root#slacker:~/ruby# heroku buildpacks:set heroku/ruby
Buildpack set. Next release on stormy-earth-98069 will use heroku/ruby.
Run git push heroku master to create a new release using this buildpack.
Next I try to update my repo using git push and I get an error saying this..
root#slacker:~/ruby# git push heroku master
...
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
...
So I am wondering what could cause git to do this?
Your question has the answer. According docs, looks like the directory from where you are running 'git push' doesn't have Gemfile.
I tried deploying my application today and my deployments are for the first time being rejected.
My deployment output is below. I've tried the following with no change in outcome:
Deploying with no Ruby version in Gemfile
Deploying with 2.1.0 in Gemfile
Deploying using a custom BUILDPACK_URL at https://github.com/heroku/heroku-buildpack-ruby.git
Deploying from a different branch
Deploying from a teammate's machine
Rolling back to last successfully deployed commit, changing a line in the README, committed and redeployed.
I had successfully deployed just last night. I only have made HTML and CSS changes to the new code I want to commit, so nothing in the app settings has been changed since the last successful deployment.
Why would Heroku be now rejecting my app deployments?
Thanks!
Fetching repository, done.
Counting objects: 11, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 496 bytes, done.
Total 6 (delta 5), reused 0 (delta 0)
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using 1.5.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
env: bundle: No such file or directory
Bundler Output: env: bundle: No such file or directory
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app
To git#heroku.com:myapp.git
! [remote rejected] development -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:myapp.git'
Heroku dropped support for Rails 1.9 and that was in the PATH. I had some trouble dropping the PATH because heroku had some hack where it was configured, but would not drop (probably because it was a default).
So I ended up setting the PATH to something
heroku config:set PATH=blah
and then unsetting it.
heroku config:remove PATH
That seems to have stuck.
With this simple Gemfile,
source 'https://rubygems.org'
gem 'activerecord', "~> 2.2.3"
gem 'activerecord-sqlserver-adapter', github: 'arthrex/activerecord-sqlserver-adapter', :branch => '2-3-stable'
bundle install fails with
Fetching git://github.com/arthrex/activerecord-sqlserver-adapter.git
fatal: unable to connect to github.com:
github.com[0: 192.30.252.131]: errno=No error
Git error: command `git clone
"git://github.com/arthrex/activerecord-sqlserver-adapter.git"
"c:/Languages/Ruby/1.9.3/lib/ruby/gems/1.9.1/cache/bundler/git/activerecord-sqlserver-adapter-8019982c6a12a1297e8a135275
d94bdee6cd893b"
--bare --no-hardlinks` in directory c:/Users/BZISAD0/Code/CSV has failed.
At first I thought my proxy configurations were screwed up but I can execute this command with no problem:
$ git clone http://github.com/arthrex/activerecord-sqlserver-adapter.git
With the git protocol, however, it fails:
$ git clone git://github.com/arthrex/activerecord-sqlserver-adapter.git
Cloning into 'activerecord-sqlserver-adapter'...
fatal: unable to connect to github.com:
github.com[0: 192.30.252.130]: errno=No error
so I'm inferring that the proxy is not playing nice with the git protocol. At any rate, for whatever reason, http is working fine but the git protocol is not.
Is there a way to work around this? E.g. configuring the use of http:// rather than git:// in my ~/.gitconfig?
Don't use the github: short form in your Gemfile, just use the regular git: syntax
gem 'activerecord-sqlserver-adapter', git: 'http://github.com/arthrex/activerecord-sqlserver-adapter.git'
Get the same problem as in (7) and tried all the possible answers but still couldnt get any headway. I wish you could be of help (bearing in mind that i am a newbie please). Here is the description of the problem # hand:
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 403 bytes, done.
Total 4 (delta 3), reused 0 (delta 0)
-----> Heroku receiving push
-----> Rails app detected
-----> 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
Windows Gemfile.lock detected, ignoring it.
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:
* source: source at vendor/engines
* source: git://github.com/Dougui/refinerycms-portfolio.git (at master)
* source: rubygems repository http://rubygems.org/
* sqlite3
* rake (= 0.8.7)
* refinerycms (~> 1.0.3)
* refinerycms-i18n (~> 1.0.0)
* fog
* refinerycms-portfolio
* refinerycms-geolocations (= 1.0)
* nokogiri
You have changed in the Gemfile:
* refinerycms-portfolio from `git://github.com/Dougui/refinerycms-portfol
io.git (at master)` to `no specified source`
* refinerycms-geolocations from `source at vendor/engines` to `no specifi
ed source`
FAILED: http://devcenter.heroku.com/articles/bundler
! Heroku push rejected, failed to install gems via Bundler
To git#heroku.com:vivid-rain-722.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:vivid-rain-722.git'
Thanks
Based on the error, your gemfile.lock is not the same as the one in repository.
Try doing the following steps.
bundle install
git add gemfile.lock
git commit -m "Add gemfile.lock"
git push heroku master