0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WiMax環境下でgem installができない

Posted at

環境

❯ sw_vers
ProductName:		macOS
ProductVersion:		15.0.1
BuildVersion:		24A348

発生した事象

gem installを実行した際、数分経ってから下記のエラーが返ってきた。

❯ gem install sinatra
ERROR:  Could not find a valid gem 'sinatra' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Gem::Net::OpenTimeout: Failed to open TCP connection to rubygems.org:443 (execution expired) (https://rubygems.org/specs.4.8.gz)

TCPコネクションが確立できなかったと言っていること、コマンド実行時の挙動からタイムアウトが発生していると思われることから、ネットワークに問題があると考えた。

解決策

nslookuprubygems.orgの名前解決ができているか確認したら、解決できていた。

❯ nslookup rubygems.org
Server:		fe80::541f:8d05:aea6:1%11
Address:	fe80::541f:8d05:aea6:1%11#53

Non-authoritative answer:
Name:	rubygems.org
Address: 151.101.65.227
Name:	rubygems.org
Address: 151.101.129.227
Name:	rubygems.org
Address: 151.101.193.227
Name:	rubygems.org
Address: 151.101.1.227

試しに、違うネットワークにつないで再度gem installしてみたら、成功した。
そこで当初のネットワーク(WiMax)に戻し、ルータのファイアウォール設定を変更してみることにした。

WiMaxのルータの設定画面(192.168.0.1)にブラウザでアクセスし、

  • フィルタリング設定を『有効』
  • インターネット接続を『許可』

にして、適用。

Screenshot 2025-01-09 at 18.14.46.png

続いて、nslookupで確認したrubygems.orgのIPアドレスに対して
ポート443での通信を許可する設定を追加した。
Screenshot 2025-01-09 at 18.17.55.png

ncコマンドで確認したら、疎通できていた。

❯ nc -vz rubygems.org 443
Connection to rubygems.org port 443 [tcp/https] succeeded!

再度gem installを実行して、インストールが成功した。

❯ gem install sinatra
Successfully installed sinatra-4.1.1
Parsing documentation for sinatra-4.1.1
Done installing documentation for sinatra after 0 seconds
1 gem installed

WiMax環境下でgem install出来なくて困っている方の参考になれば幸いです。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?