LoginSignup
3
2

More than 3 years have passed since last update.

rubygems.org に接続できない

Posted at

bundle installgem update が実行できない問題に遭遇した

PS > bundle install
Fetching source index from https://rubygems.org/
Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/
Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/
Retrying fetcher due to error (4/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/
Could not fetch specs from https://rubygems.org/
PS > gem update bundler
ERROR:  While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
    no such name (https://rubygems.org/specs.4.8.gz)

原因?

ネットで調べると rubygems.org に対して IPv6でアクセスできないとか

解決方法

hostsにIPv4アドレスを記載する

PS > nslookup.exe "rubygems.org"
# 出力された ipv4アドレス(4件くらい)をメモ

hosts を編集

Windows\System32\drivers\etc\hosts
# XXX.XXX.XXX.XXX にメモしたipv4アドレスを記載
XXX.XXX.XXX.XXX rubygems.org
XXX.XXX.XXX.XXX rubygems.org
XXX.XXX.XXX.XXX rubygems.org
XXX.XXX.XXX.XXX rubygems.org

上記の対応でgemやbundleコマンドの実行ができた

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2