[MacRuby-devel] `bytesize' does not work on NSStrings

Alexander v. Below below at mac.com
Fri Aug 27 07:37:45 PDT 2010


Hello List,

I am using MacRuby/Control Tower and have another stupid question. In somthing like this

  def call(env)
    res = @delegate.testEnvironment(env['REQUEST_PATH'])
    [200, { 'Content-Type' => 'text/html' }, res ]
  end

I get the run time error:

#<ArgumentError: method `bytesize' does not work on NSStrings>

And indeed, "testEnvironment" does return an NSString. How can I convert this?

Alex

Bonus Question: This is in a Control Tower context, but "env" is always nil. I want to access the requests parameters (i.e. foo?bar=5). That was easy in Webrick, but I can not figure out how to do it in Control Tower

@Joshua: Thanks a lot for your last reply! That helped me get going
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20100827/1ae0ab8b/attachment.html>


More information about the MacRuby-devel mailing list