« Return to Thread: i cant start webrick

Re: i cant start webrick

by Ben Lovell-2 :: Rate this Message:

Reply to Author | View in Thread

On Wed, Jul 8, 2009 at 9:41 PM, Alex Gore <gjgfuj@...> wrote:

> when i try to start webrick i get this message
>
> ./easyhtmlserver:12: syntax error, unexpected tASSOC, expecting kEND
>        :Port       => 80
>                      ^
> ./easyhtmlserver:14: syntax error, unexpected tASSOC, expecting kEND
>        :Port       => 801
>                      ^
> ./easyhtmlserver:11: warning: found = in conditional, should be ==
> ./easyhtmlserver:16: syntax error, unexpected tSYMBEG, expecting ')'
>      :DocumentRoot => "/home/" + $home + "/easyhtml/" + $pro
>       ^
> ./easyhtmlserver:17: syntax error, unexpected ')', expecting kEND
> ./easyhtmlserver:28: syntax error, unexpected $end, expecting kEND


This should work:


>
> #make the class
> class EasyHTMLServer
>  def initalize
>    s = HTTPServer.new(
>      (if $port = 80
>        :Port       => 80
>      else
>        :Port       => 801
>      end),
>      :DocumentRoot => "/home/" + $home + "/easyhtml/" + $pro
>      )
>  end
> end
>
>
But that code is pretty nasty to look at.

Regards,
Ben

 « Return to Thread: i cant start webrick