4

I wonder if a mistake was made when the question how to display ruby output in browser? was put on hold for being too broad. This question asks how to write a simple "hello world" HTTP server in the Ruby language without using any "gems" (a "gem" is an external library for Ruby).

At the time I encountered the question, it had been flagged as "too broad" but not yet closed. Several commenters noted, incorrectly, that writing an HTTP server in Ruby would either involve an external framework or library, or extensive programming using basic sockets. They are in error.

Ruby has, built into its standard library, a simple HTTP library. The simplest answer to this question is to write about six lines of Ruby that use this library. I added a comment explaining this, and then added the tested answer that demonstrates it. After that, the question received more close votes that finished it off.

How is it that a question with a simple and evident answer qualifies as "too broad?"

3
  • 1
    It ought to be obvious from the OP's comment that the answer you posted is not what he wants. That's the trouble with broad and vague questions, just about any answer seems plausible. Are you going to rewrite your answer or just give up trying to guess what he needs? Commented Jul 23, 2016 at 8:42
  • Can one reasonably edit the question to make it more focused on a specific problem? See a related answer on very much the same topic.
    – Jongware
    Commented Jul 23, 2016 at 9:47
  • @HansPassant With the OP's comment on my answer, it appears that the question was indeed vague. Either that, or we've got the usual language difficulties going on, which is kind of the same thing. Commented Jul 23, 2016 at 13:12

1 Answer 1

2

"Too broad" does not mean any and all possible good answers are too big, though that's one possibility.

It can also mean "there are too many possible answers", and I doubt using WEBrick is the only one, or even the only good one (is it actually good, if it is really "a simple http library"?).
I expect there are many alternatives of varying complexity and ability.
Point in case, someone mentioned cgi in the comments.

1
  • Although simple, webrick is suitable for the purpose. It was, for quite a long time, the library used by Ruby on Rails (Ruby's flagship framework) for running a Rails project in development mode. I'm still trying to figure out why this question, which has exactly one simple answer that we know of, has "too many answers" If a question having one or two simple answers and many complex ones is too broad, then we've got some work to do closing questions on this site. Commented Jul 23, 2016 at 13:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .