I'm trying to deploy my rails app using AWS and Elastic Beanstalk. My deployment worked but the health is at a 'red' status - error 11 (bundle install failed).
I tried:
$ gem update bundler
$ bundle package --all
Still the same error.
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# ruby "2.4.1"
+ '[' -d /var/app/ondeck/vendor/cache ']'
+ bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Warning: the running version of Bundler (1.16.0) is older than the version that created the lockfile (1.16.1). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Fetching gem metadata from https://rubygems.org/.........
Fetching https://github.com/mshibuya/remotipart.git
sh: git: command not found
Retrying `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` in directory /var/app/ondeck has failed.sh: git: command not found
Retrying `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` due to error (3/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` in directory /var/app/ondeck has failed.sh: git: command not found
Retrying `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` due to error (4/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` in directory /var/app/ondeck has failed.sh: git: command not found
Git error: command `git clone 'https://github.com/mshibuya/remotipart.git'
"/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779"
--bare --no-hardlinks --quiet` in directory /var/app/ondeck has failed.
You need to install git.
You can create a file .ebextensions/git.config in your rails app:
packages:
yum:
git: []
Then try to deploy again
By default, the Load Balancer target group uses "/" for the health check. Make sure your rails app responses to that endpoint with 200 status or you can update the health check path to a relevant one.
Related
I am trying to run bundle install while in the base dir of a git cloned Ruby on Rails repo on an Ubuntu subsystem (on Windows 10). But I keep getting this error:
Fetching gem metadata from https://rubygems.org/..........
Fetching git#bitbucket.org:wishartlab/wishart
Forbidden
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
Retrying `git clone --bare --no-hardlinks --quiet -- git#bitbucket.org:wishartlab/wishart /home/sukanta/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/cache/bundler/git/wishart-32827d90c8420e2e6b6bd9330b841cfef2863a8c` at /home/sukanta/phastest/phaster-web due to error (2/4):
Bundler::Source::Git::GitCommandError Git error: command `git clone --bare --no-hardlinks --quiet -- git#bitbucket.org:wishartlab/wishart /home/sukanta/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/cache/bundler/git/wishart-32827d90c8420e2e6b6bd9330b841cfef2863a8c` in directory /home/sukanta/phastest/phaster-web has failed.
If this error persists you could try removing the cache directory '/home/sukanta/phastest/phaster-web'
Retrying `git clone --bare --no-hardlinks --quiet -- git#bitbucket.org:wishartlab/wishart /home/sukanta/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/cache/bundler/git/wishart-32827d90c8420e2e6b6bd9330b841cfef2863a8c` at /home/sukanta/phastest/phaster-web due to error (3/4):
Bundler::Source::Git::GitCommandError Git error: command `git clone --bare --no-hardlinks --quiet -- git#bitbucket.org:wishartlab/wishart /home/sukanta/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/cache/bundler/git/wishart-32827d90c8420e2e6b6bd9330b841cfef2863a8c` in directory /home/sukanta/phastest/phaster-web has failed.
If this error persists you could try removing the cache directory '/home/sukanta/phastest/phaster-web' Retrying `git clone --bare --no-hardlinks --quiet -- git#bitbucket.org:wishartlab/wishart /home/sukanta/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/cache/bundler/git/wishart-32827d90c8420e2e6b6bd9330b841cfef2863a8c` at /home/sukanta/phastest/phaster-web due to error (4/4):
Bundler::Source::Git::GitCommandError Git error: command `git clone --bare --no-hardlinks --quiet -- git#bitbucket.org:wishartlab/wishart /home/sukanta/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/cache/bundler/git/wishart-32827d90c8420e2e6b6bd9330b841cfef2863a8c` in directory /home/sukanta/phastest/phaster-web has failed.
If this error persists you could try removing the cache directory '/home/sukanta/phastest/phaster-web'
Git error: command `git clone --bare --no-hardlinks --quiet -- git#bitbucket.org:wishartlab/wishart /home/sukanta/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/cache/bundler/git/wishart-32827d90c8420e2e6b6bd9330b841cfef2863a8c` in directory /home/sukanta/phastest/phaster-web has failed.
If this error persists you could try removing the cache directory '/home/sukanta/phastest/phaster-web'
I have added my ssh key to Bitbucket and have the rights to the repo so that should not be a problem.
I have a Rails App using Ruby 3 that I deploy using Docker. In my Gemfile I am installing the gem sunspot_rails via github, as the latest official release does not work with Ruby 3:
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem 'sunspot_rails', github: 'sunspot/sunspot', glob: 'sunspot_rails/*.gemspec'
In my Production Dockerfile I have a stage which installs the required Gems:
#####################################
# Backend Dependencies
#####################################
FROM ruby:3.0.2-alpine3.14 AS vendor
RUN apk add --no-cache \
sqlite-dev postgresql-dev \
git build-base
# Install backend packages
COPY Gemfile Gemfile.lock ./
RUN bundle config set --local deployment "true" && \
bundle config set --local without "development,test" && \
bundle install
On my local machine, this works fine.
However, when I try to build the image in my CI/CD Pipeline (using drone), I get an error implying that git could not be found:
Fetching https://github.com/sunspot/sunspot.git
Retrying `git clone https://github.com/sunspot/sunspot.git /vendor/bundle/ruby/3.0.0/cache/bundler/git/sunspot-cb781ed3afb1e1091992c51d2c44d880bb461de8 --bare --no-hardlinks --quiet` at / due to error (2/4): Errno::ENOENT No such file or directory - git
Retrying `git clone https://github.com/sunspot/sunspot.git /vendor/bundle/ruby/3.0.0/cache/bundler/git/sunspot-cb781ed3afb1e1091992c51d2c44d880bb461de8 --bare --no-hardlinks --quiet` at / due to error (3/4): Errno::ENOENT No such file or directory - git
Retrying `git clone https://github.com/sunspot/sunspot.git /vendor/bundle/ruby/3.0.0/cache/bundler/git/sunspot-cb781ed3afb1e1091992c51d2c44d880bb461de8 --bare --no-hardlinks --quiet` at / due to error (4/4): Errno::ENOENT No such file or directory - git
According to the logs, git was successfully installed the step before.
I bumped into the same issue with Ruby 3.0.2 and Alpine 3.14 image. Still waiting for CI upgrade, but I locally it works with latest Docker. Alpine requires at least Docker 20.10.0. Check if CI runs recent Docker, kernel or something else like Gitlab runner.
Upgrade to a newer or different version of docker. 22.06.0-beta.0 was the next newer one for me.
In my specific case, I was trying to build a ruby:2.7.5-alpine based docker image on CircleCI. I was getting the same error, Errno::ENOENT No such file or directory - git when git was clearly installed in the Dockerfile step immediately before bundle install. It was working locally.
The docker build command is run inside of a container on CircleCI. I had chosen the latest stable docker image version docker:20.10.17-git for the container.
After reading Ivan's answer to this question, I tried a newer docker version. The only newer image listed on Docker's official images was docker:22.06.0-beta.0-git. Switching to this new image immediately fixed my problem.
I have issue with installing gems from Github on Docker. Windows 10 pro.
Gemfile:
gem 'kaminari', git: 'https://github.com/kaminari/kaminari', branch: 'master'
Error:
Git error: command `git clone --no-checkout --quiet
"/bundle_box/cache/bundler/git/kaminari-afd5cc7513de17a7e5e6421480370a0b7ec57040"
"/bbox/bundler/gems/kaminari-27a0c850b50a"` in directory /App has failed.
If this error persists you could try removing the cache directory
'/box/cache/bundler/
git/kaminari-afd5cc7513de17a7e5e6421480370a0b7ec57040'
I try removing this cache directory. But every time same error
I am facing below error while doing bundle install using Ubuntu 14.04 with DigitalOcean
Fetching source index from https://rubygems.org/
Fetching git://github.com/activeadmin/activeadmin.git
Retrying git clone 'git://github.com/activeadmin/activeadmin.git' "/home/sachin/.rvm/gems/ruby-2.1.1/cache/bundler/git/activeadmin-c24fcef949b2f1bbdf6b5a17650dcd86d73f2528" --bare --no-hardlinks --quiet due to error (2/3): Errno::ENOMEM Cannot allocate memory - git clone 'git://github.com/activeadmin/activeadmin.git' "/home/sachin/.rvm/gems/ruby-2.1.1/cache/bundler/git/activeadmin-c24fcef949b2f1bbdf6b5a17650dcd86d73f2528" --bare --no-hardlinks --quiet
Retrying git clone 'git://github.com/activeadmin/activeadmin.git' "/home/sachin/.rvm/gems/ruby-2.1.1/cache/bundler/git/activeadmin-c24fcef949b2f1bbdf6b5a17650dcd86d73f2528" --bare --no-hardlinks --quiet due to error (3/3): Errno::ENOMEM Cannot allocate memory - git clone 'git://github.com/activeadmin/activeadmin.git' "/home/sachin/.rvm/gems/ruby-2.1.1/cache/bundler/git/activeadmin-c24fcef949b2f1bbdf6b5a17650dcd86d73f2528" --bare --no-hardlinks --quiet
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/home/sachin/.rvm/gems/ruby-2.1.1#global/gems/bundler-1.7.12/lib/bundler/source/git/git_proxy.rb:114:in ``': Cannot allocate memory - git clone 'git://github.com/activeadmin/activeadmin.git' "/home/sachin/.rvm/gems/ruby-2.1.1/cache/bundler/git/activeadmin-c24fcef949b2f1bbdf6b5a17650dcd86d73f2528" --bare --no-hardlinks --quiet (Errno::ENOMEM)
Would anybody know of a solution?
I have found solution that I do need some more memory for bundle install. That's why I have created swap in harddisk with 512MB memory and it is working fine for me.
You can create swap from here.
I'm trying to install forem on my server, and i'm getting this error when I run bundle install:
Fetching git://github.com/radar/forem.git
fatal: unable to connect to github.com:
github.com[0: 207.97.227.239]: errno=Connection refused
Git error: command `git clone 'git://github.com/radar/forem.git' "/home/box1/.bundler/cache/git/forem-8662403862ddafa624baa2b55484281b10db048e" --bare --no-hardlinks` in directory /home/box1/rails_apps/forem has failed.
Try cloning using HTTP and not SSH:
git clone https://github.com/radar/forem.git
See answer and comments to similar question.