4
4

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.

ドットインストールのRuby on Rails4入門で詰まったところ

Last updated at Posted at 2015-09-06

「Ruby on Rails 4入門」

[#03 はじめてのRuby on Rails]
(http://dotinstall.com/lessons/basic_rails_v2/24903) にて

ブラウザから http://localhost:3000 にアクセスできなくて困った


コマンドラインから

> vagrant up

PuTTYから"mycentos"の設定を読み込み
起動してログイン

login as: vagrant
password: vagrant
$ rails new myapp
$ cd ./myapp/

以下変更点

$ rails s -b 192.168.33.10

以上のようにrails sだけではなく設定したアドレスを指定してサーバーを立てる

ブラウザから*http://192.168.33.10:3000*にアクセスすると、Railsのウェルカムページを表示できるはず



追記 2015-09-07

$ rails s
$ rails s -b 127.0.0.1

バインドするIPを指定しない場合、初期値としてループバックアドレス(=localhost: 127.0.0.1)が利用されているようなので、上のふたつは同義(?)

たぶんこちらを使うのが正解

$ rails s -b 0.0.0.0
4
4
2

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?