LoginSignup
10
10

More than 5 years have passed since last update.

Rails4.2をVagrantで動かしてはまったこと

Posted at

まず、Rackの変更により、rails serverコマンドを実行した際のデフォルトのホストが0.0.0.0からlocalhostに変更されたみたいです。なので、ホストのポートをフォワードしていると接続できなくなってしまいました。

Railsを起動するのにのに-bオプションをつけて起動する必要がありました。

$ bundle exec rails server -b 0.0.0.0

あと、4.2からweb-consoleというgemが標準でついてくるようになり、これを試してみたノですが、localhostからのアクセスでしかデフォルトでは使えないようになっているようです。

config/application.rbに接続元のIPを追加してrails serverを再起動しました。

config.web_console.whitelisted_ips = %w( 127.0.0.1 192.168.0.100 10.0.2.2 )
10
10
1

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