Hello
what could I use to start and shutdown webrick from within a ruby script an not direclty from the command prompt. please Help
Thanks in advance
···
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Hanan Mneimneh wrote:
Hello
what could I use to start and shutdown webrick from within a ruby script an not direclty from the command prompt. please Help
Thanks in advance
There are some good examples here:
http://www.webrick.org/
···
--
Alex
I'm trying to start up webrick on my NT box.
irb(main):003:0> s = WEBrick::HTTPServer.new(:Port => 4567)
Errno::EBADF: Bad file descriptor
from c:/ruby/lib/ruby/1.8/webrick/log.rb:40:in `write'
from c:/ruby/lib/ruby/1.8/webrick/log.rb:40:in `<<'
from c:/ruby/lib/ruby/1.8/webrick/log.rb:40:in `log'
from c:/ruby/lib/ruby/1.8/webrick/log.rb:85:in `log'
from c:/ruby/lib/ruby/1.8/webrick/log.rb:51:in `info'
from c:/ruby/lib/ruby/1.8/webrick/server.rb:55:in `initialize'
from c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize'
from (irb):3:in `new'
from (irb):3
irb(main):004:0>
I've tried a few other port numbers picked at random, but no joy. I also
get a similar problem if I just try to open up a TCP socket, so this
seems related:
irb(main):006:0> s = Socket::TCPServer.new(45673)
Errno::EBADF: Bad file descriptor
from (irb):6:in `write'
from (irb):6
irb(main):007:0>
Could anyone suggest what the problem is?
Thanks,
Benjohn
···
from :0
from :0
Oddly, none of this happens when I run directly from irb (I've not tried
a stand alone script). I've only encountered it when I'm using the fxri
interface, so I'm just using the vanila comand line.
Strange.
Thanks,
Benjohn