[MacRuby-devel] [MacRuby] Simple embedded WEBrick?

Alexander von Below below at mac.com
Tue Apr 27 13:51:22 PDT 2010


Am 27.04.2010 um 20:42 schrieb Thibault Martin-Lagardette:

> Welcome to the MacRuby world ;-).

Thanks a lot!

> I imagine you are running MacRuby 0.5 on your machine, seeing the paths you include in your .rb file? Why are you doing all those includes by the way? All the necessary paths will be in MacRuby's default path.

I was trying to find my mistake, and looked at a friends code .... so, to be honest, I have no idea why I include them (His code is here: http://github.com/jfahrenkrug/MacRubyRemote)

> As for the "Bad Request", do you get any error log or anything?

Only: 

[2010-04-27 22:46:31] INFO  WEBrick::HTTPServer#start: pid=574 port=2000
[2010-04-27 22:46:33] ERROR bad Request-Line `GET /hello HTTP/1.1
'.
localhost - - [27/Apr/2010:22:46:33 CEST] "GET /hello HTTP/1.1
" 400 304
- -> 

> As for running the script, it depends on what you intend to do with it actually. The solution would depend on the end usage :-)

Here is, what I really want:

We need a very simple web server for our Cocoa Project. I am pretty new to Ruby, but whenever I need to test a webservice or somthing like that, I whip up a little WEBrick. But running it as a seperate task would mean I would have to establish some sort of Inter Process Communication (IPC)

But the main app is ObjC, and should remain ObjC (because I am a much better ObjC Coder than Ruby Coder).

So I thought, I could run the WEBrick embedded with MacRuby and solve all my problems.

But now that all my attempts to run the WEBrick in embedded MacRuby failed, maybe I need other options. I might try Distributed Objects, does that work in MacRuby?

But the preferred way still would be to host the WEBrink embedded in the ObjC/Cocoa app.

Thanks a lot

Alex


More information about the MacRuby-devel mailing list