rails newしたのですが、bundle installの部分でこけました。
$ bundle install
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
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/
ググったらgem updateしろと出てきたのでしてみましたが、こちらもNG
$ gem update -V --system
ERROR: While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
timed out (https://api.rubygems.org/specs.4.8.gz)
wgetもできない
$ wget https://api.rubygems.org/specs.4.8.gz
--2018-11-28 21:49:23-- https://api.rubygems.org/specs.4.8.gz
api.rubygems.org (api.rubygems.org) をDNSに問いあわせています... 2a04:4e42:400::70, 2a04:4e42::70, 2a04:4e42:200::70, ...
api.rubygems.org (api.rubygems.org)|2a04:4e42:400::70|:443 に接続しています... 失敗しました: Operation timed out.
api.rubygems.org (api.rubygems.org)|2a04:4e42::70|:443 に接続しています... 失敗しました: Operation timed out.
api.rubygems.org (api.rubygems.org)|2a04:4e42:200::70|:443 に接続しています... ^C
IPv6での通信ができないのか?と思いググったらそうっぽい
api.rubygems.org is currently experiencing issues with IPv6 setup: this hostname has 4 IPv6 addresses, but responds on neither of them. Neither to ping, nor to TCP connection attempts. "
4つのIPv6アドレスを持っているがどれも応答しないとのこと
rubygems.orgのIPv4アドレスを調べてhostsに記載して無事解決!
$ host rubygems.org
rubygems.org has address 151.101.128.70
rubygems.org has address 151.101.64.70
rubygems.org has address 151.101.0.70
rubygems.org has address 151.101.192.70
rubygems.org has IPv6 address 2a04:4e42:600::70
rubygems.org has IPv6 address 2a04:4e42::70
rubygems.org has IPv6 address 2a04:4e42:400::70
rubygems.org has IPv6 address 2a04:4e42:200::70
rubygems.org mail is handled by 10 mxa.mailgun.org.
rubygems.org mail is handled by 10 mxb.mailgun.org.
$ sudo vi /etc/hosts
$ bundle install
Fetching source index from https://rubygems.org/
--- 省略! ---
Bundle complete! 19 Gemfile dependencies, 81 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.