Search code examples
ruby-on-railsrubywebrick

Running Rails S with a fresh new app returns ERR_EMPTY_RESPONSE


I am using Vagrant to start a Rails app, everything seems right but then, when I create a test app, run rails s and go to localhost:3000 I get a ERR_EMPTY_RESPONSE and nothing is loaded. I get the following output when running rails s:

vagrant@rails-dev-box:~/projects/NewAppName$ rails s
=> Booting WEBrick
=> Rails 4.2.3 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-08-20 11:45:45] INFO  WEBrick 1.3.1
[2015-08-20 11:45:45] INFO  ruby 2.2.1 (2015-02-26) [i686-linux]
[2015-08-20 11:45:45] INFO  WEBrick::HTTPServer#start: pid=12075 port=3000

I already ran rake db:create && rake db:migrate, and created a controller for the root. Anyone has an idea of what can be happening? Thank you.


Solution

  • It's in localhost on vagrant, so you can't connect it. Try rails s -b 0.0.0.0 and then connect to vagrant IP(192.168.50.4:3000, for example).