![]() |
Ruby Setup - LSAPI
Okay, so I'm setting up Ruby (not Ruby on Rails) to work with LSWS with the new LSAPI module, and I need a little help. I decided to use the dispatcher, so I created a LSAPI module with a url of a /tmp/lshttpd/ruby_ns.sock, and the command being the lsruby_runner.rb script. I added a Script Handler for .rb, and it's returning a 503...I know I'm doing something wrong, which is why I'm asking for a little help here. :)
|
Have you built and installed the ruby extension? Is execution bit enabled for ruby_runner.rb?
For trouble shooting, please check lsws/logs/error.log and stderr.log |
Yes, I built and installed the Ruby extension, and it is chmodded to allow execution.
Log: Code:
2006-04-28 00:02:44.121 [DEBUG] [66.243.195.111:63346-0#Nanoshock] New request: |
Don't know what exactly is the problem, below is our RubyRunner configuration, you can give it a try.
Code:
Name RubyRunner |
Okay, it's halfway working now (no more errors in log), but now it returns a 500 error.
Settings: Code:
Name RubyRunnerCode:
2006-05-02 20:40:05.480 DEBUG [64.191.7.230:80] New connection from 64.191.7.230:37065. |
I am not exactly sure what is the problem, maybe support for your ruby script is poor. You can try the following hello.rb, if it works, please send us your testing script, we will figure out the problem.
Code:
#!/usr/local/bin/ruby |
Aha it works now with the script you gave me, however it appears your testcgi.rb script is malfunctioning on my setup, which was what "test.rb" was.
|
testcgi.rb itself is using LSAPI interface, it is for testing the ruby "cgi" extension under LSAPI. Itself is a LSAPI application, It will not work under the lsruby_runner.
|
Aha, I should have thought of that. :oops:
Thank you for your help, and out of curiousity how would I make LSAPI work directly from the script (ie, requiring it in then using the blocks given)? A context? |
Yes, the extra code for LSAPI is pretty simple.
You need to define a LSAPI application for each LSAPI ruby script, then mount the application via a context or script handler. |
| All times are GMT -7. The time now is 07:54 AM. |