I’m trying to learn Ruby on Rails. When I build my app and try to run the server with rails s I get the following:
**radu@radu ~/rails_projects/first_app $ rails s
=> Booting WEBrick
=> Rails 3.2.6 application starting in development on http:// 0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-07-06 15:30:09] INFO WEBrick 1.3.1
[2012-07-06 15:30:09] INFO ruby 1.8.7 (2011-06-30) [i686-linux]
[2012-07-06 15:30:14] INFO WEBrick::HTTPServer#start: pid=8179 port=3000**
Then it stops for no apparent reason and T can’t do anything except close it with ctrl+c.
What can I do to fix this?
rails sruns the web server that ships with rails. All that does is sit in the background as a process and listens for incoming web requests on port 3000 on localhost. Run it again and go tohttp://localhost:3000.Are you expecting more of a console where you can interact with your application? If so, what you want is
rails consolewhich allows you to interact with your app. You can write and run code – really useful for trying out things on the fly before you commit them to code in your app.