0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

localhost:3000に接続出来ない”The requested URL could not be retrieved”

Last updated at Posted at 2016-09-29

今日朝からずっとWEBrickは起動しているのにブラウザでhttp://localhost:3000 に接続出来なくなる現象に陥った。

ブラウザ側エラー表示

ERROR
The requested URL could not be retrieved
The following error was encountered while trying to retrieve the URL: http://localhost:3000/
::1 への接続に失敗しました。
システムが以下のエラーを返しました: (111) Connection refused
The remote host or network may be down. Please try the request again.
Your cache administrator is root.

環境

Rails備忘録:開発環境
http://qiita.com/Syatiku-Kun/items/61895441e403c2c359ae
(OS windows7 Pro 32bit, Ruby 1.9.3, RubyGem 1.8.24, Rails 4.0.0)

解決策

windowsコントロールパネル>インターネットオプション>LANの設定>"プロキシサーバー"内の
「ローカルアドレスにはプロキシサーバーを使用しない」チェックボックスにチェックを入れる

それでも解決しない時
C:\Windows\System32\drivers\etc\hosts
を管理者権限で編集
# localhost name resolution is handled within DNS itself
127.0.0.1 localhost
# ::1 localhost

これでもまだ直らないとき
コンソール(cmd)で
> rails s -b 0.0.0.0
とすると http://0.0.0.0:3000 にアクセスすることが出来るようになる
※0.0.0.0はもちろん変更可

あとはIPv6をコンパネから無効化するのも手
ネットワークと共有センター>アダプターの設定>該当する接続の"プロパティ"を開く>
>インターネットプロトコルバージョン6(TCP/IPv6)のチェックボックスを外す

それでも直らない場合はとりあえずコンソールで
> netstat
を打ち込んでみよう。接続先が一覧で出てきて状態も見れます。

結局単純なミスで午前中無駄にしてしまった...。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?