teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

書式の改善

2021/09/29 22:04

投稿

xiaoxishicheng
xiaoxishicheng

スコア0

title CHANGED
File without changes
body CHANGED
@@ -106,13 +106,26 @@
106
106
  Length: 4485268 (4.3M) [application/octet-stream]
107
107
  Saving to: ‘specs.4.8.gz.1’
108
108
  ```
109
+ - [gem cannot access rubygems.org](https://stackoverflow.com/questions/49800432/gem-cannot-access-rubygems-org)には以下のことが書いてありました。
109
110
 
110
111
  > 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. "When you are running `gem`, your `gem` tries IPv6 addresses first and times out on them, not having time to even try IPv4 addresses.
111
112
 
112
113
  > The solution is to lower priority of IPv6 addresses for `api.rubygems.org`, so that `gem` will try IPv4 addresses first. In order to do it, put these lines into `/etc/gai.conf`:
113
114
 
114
- - 以上のことから、rubygems.orgのIPv4アドレス調べてhostsにてみました。
115
+ - 以上のことから、`sudo vi /etc/gai.conf`で、以下を記しましたが変わりがなかったです
115
116
  ```text
117
+ # Debian defaults.
118
+ precedence ::1/128 50
119
+ precedence ::/0 40
120
+ precedence 2002::/16 30
121
+ precedence ::/96 20
122
+ precedence ::ffff:0:0/96 10
123
+
124
+ # Low precedence for api.rubygems.org IPv6 addresses.
125
+ precedence 2a04:4e42::0/32 5
126
+ ```
127
+ - rubygems.orgのIPv4アドレスを調べてhostsに記載もしてみましたが変わらなかったです。
128
+ ```text
116
129
  $ host rubygems.org
117
130
  rubygems.org has address 151.101.193.227
118
131
  rubygems.org has address 151.101.129.227
@@ -150,22 +163,8 @@
150
163
  $ gem update --system
151
164
  ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
152
165
  Net::OpenTimeout: execution expired (https://rubygems.org/specs.4.8.gz)
153
-
154
166
  ```
155
167
 
156
- - `sudo vi /etc/gai.conf`で、以下も記述しましたが、変わりがなかったです。
157
- ```text
158
- # Debian defaults.
159
- precedence ::1/128 50
160
- precedence ::/0 40
161
- precedence 2002::/16 30
162
- precedence ::/96 20
163
- precedence ::ffff:0:0/96 10
164
-
165
- # Low precedence for api.rubygems.org IPv6 addresses.
166
- precedence 2a04:4e42::0/32 5
167
- ```
168
-
169
168
  #### 参考
170
169
  - [rails5.2 bundle installがこけるので原因を調査してみた - Qiita](https://qiita.com/kzyo/items/f0c031d5cabdcf1aeb8f)
171
170
  - [gem cannot access rubygems.org](https://stackoverflow.com/questions/49800432/gem-cannot-access-rubygems-org)