element119
element119

Reputation: 7625

Somehow WEBrick is taking over my Sinatra app launch, how to turn it off?

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.

Upvotes: 1

Views: 1423

Answers (2)

gioele
gioele

Reputation: 10205

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.

Upvotes: 3

three
three

Reputation: 8478

That is the normal logging output Sinatra creates.

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

Upvotes: 1

Related Questions