尝试从GitHub存储库获取宝石时,Bundler无法解决主机
预计运行捆绑式安装
从GITHUB存储库中获取GETHUB URL中指定Gemfile中指定的GEMS。
就我而言,我遇到了很多错误:
bitkoin-api git:(main) bundle install
Fetching gem metadata from https://rubygems.org/......
fatal: unable to access 'https://github.comUsers/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/cache/bundler/git/double_entry-822076161735bb2415359ce4bc5bd8848ea609b9/': Could not resolve host: github.comUsers
Retrying `git clone --no-checkout --quiet /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/cache/bundler/git/double_entry-822076161735bb2415359ce4bc5bd8848ea609b9 /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/double_entry-
6427f6bcaeec` at /Users/bashorun/dev/bitkoin-api due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `git clone --no-checkout --quiet /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/cache/bundler/git/double_entry-822076161735bb2415359ce4bc5bd8848ea609b9 /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/double_entry-6427f6bcaeec` in directory /Users/bashorun/dev/bitkoin-api has failed.
If this error persists you could try removing the cache directory '/Users/bashorun/dev/bitkoin-api'
Retrying `git clone --no-checkout --quiet /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/cache/bundler/git/double_entry-822076161735bb2415359ce4bc5bd8848ea609b9 /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/double_entry-6427f6bcaeec` at /Users/bashorun/dev/bitkoin-api due to error (3/4): Bundler::Source::Git::GitCommandError Git error: command `git clone --no-checkout --quiet /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/cache/bundler/git/double_entry-822076161735bb2415359ce4bc5bd8848ea609b9 /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/double_entry-6427f6bcaeec` in directory /Users/bashorun/dev/bitkoin-api has failed.
If this error persists you could try removing the cache directory '/Users/bashorun/dev/bitkoin-api'
Retrying `git clone --no-checkout --quiet /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/cache/bundler/git/double_entry-822076161735bb2415359ce4bc5bd8848ea609b9 /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/double_entry-6427f6bcaeec` at /Users/bashorun/dev/bitkoin-api due to error (4/4): Bundler::Source::Git::GitCommandError Git error: command `git clone --no-checkout --quiet /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/cache/bundler/git/double_entry-822076161735bb2415359ce4bc5bd8848ea609b9 /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/double_entry-6427f6bcaeec` in directory /Users/bashorun/dev/bitkoin-api has failed.
If this error persists you could try removing the cache directory '/Users/bashorun/dev/bitkoin-api'
Git error: command `git clone --no-checkout --quiet
/Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/cache/bundler/git/double_entry-822076161735bb2415359ce4bc5bd8848ea609b9
/Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/double_entry-6427f6bcaeec` in directory /Users/bashorun/dev/bitkoin-api has failed.
If this error persists you could try removing the cache directory '/Users/bashorun/dev/bitkoin-api'
从错误中,看起来像捆绑包试图通过投掷致命:无法访问'https://github.comusers/bashorun/,从那里无效的URL获取存储库。 .rbenv/versions/2.7.2 /.../ double_entry-822076161735BB2415359CE4BC5BD8848EA609B9/':无法解决主机:Github.com.users
错误。
NB:当所有带有GitHub URL的宝石都删除时,捆绑安装效果很好。
Gemfile:
# frozen_string_literal: true
source 'https://rubygems.org'
ruby '~> 2.7.2'
# Ruby on Rails
gem 'rails', '~> 6.0.3', '>= 6.0.3.1'
gem 'bootsnap', require: false
# ActiveRecord
gem 'enumerize'
gem 'pg'
gem 'migration_data'
gem 'validate_url'
gem 'double_entry', git: 'https://github.com/buycoinsafrica/double_entry.git', branch: 'master'
# Firebase
gem 'google-cloud-firestore'
# Analytics
gem 'analytics-ruby'
# Crypto
gem 'coinbase', '4.2.2'
gem 'adequate_crypto_address'
# Orchestration
gem 'envied'
gem 'puma'
gem 'rack-attack', '~> 6.2', '>= 6.2.2'
gem 'redis', '~> 4.2', '>= 4.2.1'
gem 'redis-objects', '~> 1.5'
# CORS
gem 'rack-cors'
# PubSub
gem 'google-cloud-pubsub'
# ProtoBuf
gem 'protos-gem', git: 'https://[email protected]/buycoinsafrica/protos-gem', branch: 'master' # do not fear, access token has read only powers
# GraphQL
gem 'graphiql-rails', '~> 1.4'
gem 'graphql', git: 'https://github.com/buycoinsafrica/graphql-ruby', branch: 'master'
# GraphQL
gem 'artemis'
gem 'grpc'
# Webhook
gem 'convoy.rb'
# Authentication
gem 'devise'
gem 'knock', git: 'https://github.com/nsarno/knock.git', branch: 'master'
# 2fa
gem 'active_model_otp'
gem 'rotp', '~>3.3.1'
# Background jobs
gem 'clockwork'
gem 'sidekiq', '~> 6.0', '>= 6.0.7'
gem 'sidekiq-failures'
# Business logic
gem 'interactor-rails'
# Console love
gem 'awesome_print'
# Paystack Integration
gem 'paystack', git: 'https://github.com/timigod/paystack-ruby.git', branch: 'feature/ta-transfers-verify'
# Synapse Integration
gem 'synapse_pay_rest'
# HTTP Requests
gem 'httparty'
# Notifications
gem 'hertz'
gem 'hertz-email'
gem 'hertz-twilio'
gem 'sinch_sms'
# Optimisation
gem 'bullet'
gem 'goldiloader'
gem 'pghero'
gem 'pg_query', '~> 1.2'
gem 'newrelic_rpm'
gem 'by_star'
gem 'twitter'
gem 'time_difference'
gem 'humanize'
# Error logging
gem 'sentry-raven'
gem 'browser'
# Soft delete
gem 'discard', '~> 1.1'
# Track changes
gem 'audited', '~> 4.8'
# Push notifications
gem 'fcm', '~> 0.0.6'
# Param validation
gem 'rails_param', '~> 0.11.0'
# Serializers
gem 'fast_jsonapi', '~> 1.5'
# Telegram
gem 'telegram-bot'
gem 'telegram-bot-types'
# Drip
gem 'drip-ruby', require: 'drip'
# Websocket Client
gem 'faye-websocket', '~> 0.10.9'
# Device detection
gem 'device_detector'
gem 'active_record_query_trace'
# View emails in development
gem 'letter_opener'
gem 'letter_opener_web'
# Phone number formatting
gem "phonelib"
# Social feed
gem 'stream-ruby', '4.4'
# Heroku Orchestration
gem 'platform-api', '~> 3.0.0'
group :development, :test do
# Factories
gem "factory_bot_rails"
gem 'faker'
# Debugging
gem 'pry-rails'
# Testing
gem 'rspec-rails'
# Orchestration
gem 'dotenv-rails'
gem 'database_cleaner'
gem 'timecop'
gem 'recursive-open-struct'
end
group :development do
# Annotate models
gem 'annotate'
# Code quality
gem 'rubocop'
gem 'rubocop-rspec'
gem 'rubocop-faker'
# Preloading
gem 'listen', '>= 3.0.5', '< 3.2'
# gem 'spring'
# gem 'spring-watcher-listen', '~> 2.0.0'
# ERD
gem 'rails-erd'
end
group :test do
gem 'shoulda-matchers'
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw]
gem 'wdm', platforms: %i[mingw mswin x64_mingw]
gem 'webmock'
gem 'fakeredis'
gem 'simplecov', require: false
# CircleCI
gem 'rspec_junit_formatter'
end
It's expected that running bundle install
fetches the gems from GitHub repositories that have their GitHub url specified in the Gemfile.
In my case, I get a bunch of errors:
bitkoin-api git:(main) bundle install
Fetching gem metadata from https://rubygems.org/......
fatal: unable to access 'https://github.comUsers/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/cache/bundler/git/double_entry-822076161735bb2415359ce4bc5bd8848ea609b9/': Could not resolve host: github.comUsers
Retrying `git clone --no-checkout --quiet /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/cache/bundler/git/double_entry-822076161735bb2415359ce4bc5bd8848ea609b9 /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/double_entry-
6427f6bcaeec` at /Users/bashorun/dev/bitkoin-api due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `git clone --no-checkout --quiet /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/cache/bundler/git/double_entry-822076161735bb2415359ce4bc5bd8848ea609b9 /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/double_entry-6427f6bcaeec` in directory /Users/bashorun/dev/bitkoin-api has failed.
If this error persists you could try removing the cache directory '/Users/bashorun/dev/bitkoin-api'
Retrying `git clone --no-checkout --quiet /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/cache/bundler/git/double_entry-822076161735bb2415359ce4bc5bd8848ea609b9 /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/double_entry-6427f6bcaeec` at /Users/bashorun/dev/bitkoin-api due to error (3/4): Bundler::Source::Git::GitCommandError Git error: command `git clone --no-checkout --quiet /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/cache/bundler/git/double_entry-822076161735bb2415359ce4bc5bd8848ea609b9 /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/double_entry-6427f6bcaeec` in directory /Users/bashorun/dev/bitkoin-api has failed.
If this error persists you could try removing the cache directory '/Users/bashorun/dev/bitkoin-api'
Retrying `git clone --no-checkout --quiet /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/cache/bundler/git/double_entry-822076161735bb2415359ce4bc5bd8848ea609b9 /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/double_entry-6427f6bcaeec` at /Users/bashorun/dev/bitkoin-api due to error (4/4): Bundler::Source::Git::GitCommandError Git error: command `git clone --no-checkout --quiet /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/cache/bundler/git/double_entry-822076161735bb2415359ce4bc5bd8848ea609b9 /Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/double_entry-6427f6bcaeec` in directory /Users/bashorun/dev/bitkoin-api has failed.
If this error persists you could try removing the cache directory '/Users/bashorun/dev/bitkoin-api'
Git error: command `git clone --no-checkout --quiet
/Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/cache/bundler/git/double_entry-822076161735bb2415359ce4bc5bd8848ea609b9
/Users/bashorun/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/double_entry-6427f6bcaeec` in directory /Users/bashorun/dev/bitkoin-api has failed.
If this error persists you could try removing the cache directory '/Users/bashorun/dev/bitkoin-api'
From the error, it looks like bundle tries to fetch the repository from an invalid url there by throwing fatal: unable to access 'https://github.comUsers/bashorun/.rbenv/versions/2.7.2/.../double_entry-822076161735bb2415359ce4bc5bd8848ea609b9/': Could not resolve host: github.comUsers
, Bundler::Source::Git::GitCommandError
, error.
NB: bundle install works well when all gems with Github urls are removed.
Gemfile:
# frozen_string_literal: true
source 'https://rubygems.org'
ruby '~> 2.7.2'
# Ruby on Rails
gem 'rails', '~> 6.0.3', '>= 6.0.3.1'
gem 'bootsnap', require: false
# ActiveRecord
gem 'enumerize'
gem 'pg'
gem 'migration_data'
gem 'validate_url'
gem 'double_entry', git: 'https://github.com/buycoinsafrica/double_entry.git', branch: 'master'
# Firebase
gem 'google-cloud-firestore'
# Analytics
gem 'analytics-ruby'
# Crypto
gem 'coinbase', '4.2.2'
gem 'adequate_crypto_address'
# Orchestration
gem 'envied'
gem 'puma'
gem 'rack-attack', '~> 6.2', '>= 6.2.2'
gem 'redis', '~> 4.2', '>= 4.2.1'
gem 'redis-objects', '~> 1.5'
# CORS
gem 'rack-cors'
# PubSub
gem 'google-cloud-pubsub'
# ProtoBuf
gem 'protos-gem', git: 'https://[email protected]/buycoinsafrica/protos-gem', branch: 'master' # do not fear, access token has read only powers
# GraphQL
gem 'graphiql-rails', '~> 1.4'
gem 'graphql', git: 'https://github.com/buycoinsafrica/graphql-ruby', branch: 'master'
# GraphQL
gem 'artemis'
gem 'grpc'
# Webhook
gem 'convoy.rb'
# Authentication
gem 'devise'
gem 'knock', git: 'https://github.com/nsarno/knock.git', branch: 'master'
# 2fa
gem 'active_model_otp'
gem 'rotp', '~>3.3.1'
# Background jobs
gem 'clockwork'
gem 'sidekiq', '~> 6.0', '>= 6.0.7'
gem 'sidekiq-failures'
# Business logic
gem 'interactor-rails'
# Console love
gem 'awesome_print'
# Paystack Integration
gem 'paystack', git: 'https://github.com/timigod/paystack-ruby.git', branch: 'feature/ta-transfers-verify'
# Synapse Integration
gem 'synapse_pay_rest'
# HTTP Requests
gem 'httparty'
# Notifications
gem 'hertz'
gem 'hertz-email'
gem 'hertz-twilio'
gem 'sinch_sms'
# Optimisation
gem 'bullet'
gem 'goldiloader'
gem 'pghero'
gem 'pg_query', '~> 1.2'
gem 'newrelic_rpm'
gem 'by_star'
gem 'twitter'
gem 'time_difference'
gem 'humanize'
# Error logging
gem 'sentry-raven'
gem 'browser'
# Soft delete
gem 'discard', '~> 1.1'
# Track changes
gem 'audited', '~> 4.8'
# Push notifications
gem 'fcm', '~> 0.0.6'
# Param validation
gem 'rails_param', '~> 0.11.0'
# Serializers
gem 'fast_jsonapi', '~> 1.5'
# Telegram
gem 'telegram-bot'
gem 'telegram-bot-types'
# Drip
gem 'drip-ruby', require: 'drip'
# Websocket Client
gem 'faye-websocket', '~> 0.10.9'
# Device detection
gem 'device_detector'
gem 'active_record_query_trace'
# View emails in development
gem 'letter_opener'
gem 'letter_opener_web'
# Phone number formatting
gem "phonelib"
# Social feed
gem 'stream-ruby', '4.4'
# Heroku Orchestration
gem 'platform-api', '~> 3.0.0'
group :development, :test do
# Factories
gem "factory_bot_rails"
gem 'faker'
# Debugging
gem 'pry-rails'
# Testing
gem 'rspec-rails'
# Orchestration
gem 'dotenv-rails'
gem 'database_cleaner'
gem 'timecop'
gem 'recursive-open-struct'
end
group :development do
# Annotate models
gem 'annotate'
# Code quality
gem 'rubocop'
gem 'rubocop-rspec'
gem 'rubocop-faker'
# Preloading
gem 'listen', '>= 3.0.5', '< 3.2'
# gem 'spring'
# gem 'spring-watcher-listen', '~> 2.0.0'
# ERD
gem 'rails-erd'
end
group :test do
gem 'shoulda-matchers'
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw]
gem 'wdm', platforms: %i[mingw mswin x64_mingw]
gem 'webmock'
gem 'fakeredis'
gem 'simplecov', require: false
# CircleCI
gem 'rspec_junit_formatter'
end
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论