From: "P. A." Date: 2009-12-08T16:46:12+09:00 Subject: Re: WEBrick doesn't work (permission/port error) I solved it by myself. The problem was that I stated a WEBrick server without initial configuration because I used the Hash#merge method instead Hash#merge! (mutator). So, the code should be changed to work properly. # IT DOESN'T WORKS! # encoding: utf-8 require 'webrick' class Server class << self def start(config = {}) config.merge(:BindAddress => '0.0.0.0', :Port => 4321) # the error source puts config # returns {} on start server = WEBrick::HTTPServer.new(config) trap('INT') { server.shutdown } server.start end end end # WORKS! # encoding: utf-8 require 'webrick' class Server class << self def start(config = {}) config.merge!(:BindAddress => '0.0.0.0', :Port => 4321) # changes the config hash puts config # returns {:BindAddress => '0.0.0.0', :Port => 4321} on start server = WEBrick::HTTPServer.new(config) trap('INT') { server.shutdown } server.start end end end Cheers! -- Posted via http://www.ruby-forum.com/.