Search code examples
rubyruby-on-rails-4pathwebricklocalserver

rails s doesn't start server, no error messages


I haven't been able to find previous answered questions on this, unless I'm missing one. Anyways, when I try starting a rails server:

vagrant [accounts]> rails s
=> Booting WEBrick
=> Rails 4.2.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-06-06 02:38:50] INFO  WEBrick 1.3.1
[2015-06-06 02:38:50] INFO  ruby 2.2.2 (2015-04-13) [i686-linux]
[2015-06-06 02:38:50] INFO  WEBrick::HTTPServer#start: pid=23016 port=3000

But that's all I ever get, no error messages or anything. Of course localhost:3000 produces 'no data received'

As you can see I'm using Ruby 2.2.2 and Rails 4.2.1 I'm in the root for the app, have tried updating bin. I'm using the sqlite3 gem, I've created and migrated the db. I am convinced it has nothing to do with this particular rails app because I've gone back and tried to open old projects that are now having the same problem. Recently I've upgraded from Ubuntu 12.04 to 14.04 on my vm. I've also recently upgraded ruby (I manage with rvm) and rails. I've also recently put some stuff on heroku. All of this has messed with $PATH (I'm not sure if this is related, I'm pretty new to all this stuff). Just wanted to detail everything I could think of that might have an effect.

Thanks!


Solution

  • I ran into the following problem recently, could this be your issue also?

    If so try

    rails s -b 0.0.0.0
    

    3.3 Default Host for rails server Due to a change in Rack, rails server now listens on localhost instead of 0.0.0.0 by default. This should have minimal impact on the standard development workflow as both http://127.0.0.1:3000 and http://localhost:3000 will continue to work as before on your own machine.

    However, with this change you will no longer be able to access the Rails server from a different machine, for example if your development environment is in a virtual machine and you would like to access it from the host machine. In such cases, please start the server with rails server -b 0.0.0.0 to restore the old behavior.

    If you do this, be sure to configure your firewall properly such that only trusted machines on your network can access your development server.

    See the release notes here for the details.