Bundler::Source::Git::GitCommandError when using Inquisition gem - ruby-on-rails

As per the client suggestion, I am using inquisition gem in my Rails 5.0 application. I followed this link and added gem in Gemfile and ran bundle, I got the following error:
E:\rails_projects\inquisition_example>bundle Fetching
https://github.com/rubygarage/inquisition.git fatal: unable to access
'https://github.com/rubygarage/inquisition.git/': error:1407742E:SSL
routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
Retrying git clone "https://github.com/rubygarage/inquisition.git"
"C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/cache/bundler/git/inquisition-40e0b17fff1501354aa91e3ff3bbb85f990b5f49"
--bare --no-hardlinks --quiet due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command git clone
"https://github.com/rubygarage/inquisition.git"
"C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/cache/bundler/git/inquisition-40e0b17fff1501354aa91e3ff3bbb85f990b5f49"
--bare --no-hardlinks --quiet in directory E:/rails_projects/inquisition_example has failed. fatal: unable to
access 'https://github.com/rubygarage/inquisition.git/':
error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert
protocol version
Please help me out.

This error means that the OpenSSL version you are using in Git's libcurl is too old. GitHub only supports TLS 1.2 and 1.3, and the version of OpenSSL that libcurl is compiled with doesn't know how to negotiate those versions.
Since it looks like you're using Windows, you should update Git for Windows to the latest version, which will include an updated version of OpenSSL and libcurl so Git will work.

Related

Git error: unable to run post install scripts

Git error after installation
I am getting this error after I am installing Git in Windows 10. I am unable to find a solution for this. What to do?

Brew install fails with 403 Unauthorized

Despite having installed other packages successfully with brew, I am unable to install maven.
After running brew install maven, I get the following error:
curl: (18) transfer closed with 9103121 bytes remaining to read
Error: maven: Failed to download resource "maven"
Download failed: https://ghcr.io/v2/homebrew/core/maven/blobs/sha256:ff38bb52b93216582dbd13fb00be5679090ac4b66f7e7c5c8cae5f70626238bb
I am using the following versions of brew and git:
$ brew --version
Homebrew 3.3.8
Homebrew/homebrew-core (git revision 7c983d9c784; last commit 2021-12-13)
Homebrew/homebrew-cask (git revision 538992b1fb; last commit 2021-12-13)
$ git --version
git version 2.23.0
When visiting the failed download in my browser, I also get a 403 failure:
{"errors":[{"code":"UNAUTHORIZED","message":"authentication required"}]}
This error is strange to me because I would not think brew dependencies for public taps like for maven would require authorization.
My work network/VPN was causing this error. I was able to download successfully disabling my VPN and using my mobile network connection.

Ruby + Alpine + Docker: git cannot be found when it's installed?

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.

pod cannot be installed

I have problem with running app on ios that was cloned from github i tried to install pod put it giving me this error.
[!] Error installing MaterialControls
[!] /usr/local/bin/git clone https://github.com/fpt-software/Material-Controls-For-iOS.git /var/folders/0s/r4qtkcpj5wsbp5qrn3x224x00000gn/T/d20200819-21909-1j0u8aj --template= --single-branch --depth 1 --branch v1.2.2
Cloning into '/var/folders/0s/r4qtkcpj5wsbp5qrn3x224x00000gn/T/d20200819-21909-1j0u8aj'...
remote: Repository not found.
fatal: repository 'https://github.com/fpt-software/Material-Controls-For-iOS.git/' not found
Let's try to run pod install inside your IOS folder
This project does not exist anymore, so that's the probleme. You can try to open a new project and copy the dart files, if you still have them.

Ruby bundle install error

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.

Resources