1

A while ago, I was fooling around with Node.js (I don't really remember what I did).

Now, whenever I launch Sinatra apps, I get this:

mba:sinatra chromium$ ruby basics.rb
[2011-12-16 18:38:23] INFO  WEBrick 1.3.1
[2011-12-16 18:38:23] INFO  ruby 1.9.2 (2011-07-09) [x86_64-darwin11.0.1]
== Sinatra/1.3.1 has taken the stage on 4567 for development with backup from WEBrick
[2011-12-16 18:38:23] INFO  WEBrick::HTTPServer#start: pid=5708 port=4567
127.0.0.1 - - [16/Dec/2011 18:38:51] "GET / HTTP/1.1" 200 13 0.0072
localhost - - [16/Dec/2011:18:38:51 EST] "GET / HTTP/1.1" 200 13
- -> /

And for each HTTP request, WEBrick logs like 5 more lines.

How do I turn this off? I have no idea why this is happening, because I was doing this with Node.js, not WEBrick.

element119
  • 7,475
  • 8
  • 51
  • 74
  • Why would anything from `node.js` (a JavaScript-based server implementation) have anything to do with `Sinatra` (a Ruby-based server implementation)? :) – sarnold Dec 16 '11 at 23:57
  • I have no idea, that's why I'm posting the question :P The last time I saw WEBrick was node.js. – element119 Dec 16 '11 at 23:59
  • I'd love to see some `node` output indicating WEBrick anywhere near by :) – sarnold Dec 17 '11 at 00:01

2 Answers2

3

The line ruby basics.rb means that you are running Sinatra with Ruby, not Node.js.

If you want your Sinatra application launch a simple CGI daemon, not a complete HTTP server, you should use Sinatra::Base, not the normal Sinatra infrastructure. Applications based on Sinatra::Base do not launch WEBRick or any other server at startup and rely on an external HTTP server.

Have a look at the introduction to Sinatra::Base.

gioele
  • 9,748
  • 5
  • 55
  • 80
1

That is the normal logging output Sinatra creates.

Check the Readme if you want to turn logging off: https://github.com/sinatra/sinatra

three
  • 8,262
  • 3
  • 35
  • 39
  • Really? All the tutorials I've seen haven't included it, maybe they've just simplified the terminal output. – element119 Dec 17 '11 at 00:00