Problem installing ruby-lsapi

#1
I'm having problems installing ruby-lsapi on Solaris 10. When I run 'gem install ruby-lsapi' I get the following errors:

Building native extensions. This could take a while...
In file included from /usr/include/sys/signal.h:34,
from /usr/include/signal.h:26,
from lsapilib.c:52:
/usr/include/sys/siginfo.h:259: error: parse error before "ctid_t"
/usr/include/sys/siginfo.h:292: error: parse error before '}' token
/usr/include/sys/siginfo.h:294: error: parse error before '}' token
/usr/include/sys/siginfo.h:390: error: parse error before "ctid_t"
/usr/include/sys/siginfo.h:392: error: conflicting types for `__proc'
/usr/include/sys/siginfo.h:261: error: previous declaration of `__proc'
/usr/include/sys/siginfo.h:398: error: conflicting types for `__fault'
/usr/include/sys/siginfo.h:267: error: previous declaration of `__fault'
/usr/include/sys/siginfo.h:404: error: conflicting types for `__file'
/usr/include/sys/siginfo.h:273: error: previous declaration of `__file'
/usr/include/sys/siginfo.h:420: error: conflicting types for `__prof'
/usr/include/sys/siginfo.h:287: error: previous declaration of `__prof'
/usr/include/sys/siginfo.h:424: error: conflicting types for `__rctl'
/usr/include/sys/siginfo.h:291: error: previous declaration of `__rctl'
/usr/include/sys/siginfo.h:426: error: parse error before '}' token
/usr/include/sys/siginfo.h:428: error: parse error before '}' token
/usr/include/sys/siginfo.h:432: error: parse error before "k_siginfo_t"
/usr/include/sys/siginfo.h:437: error: parse error before '}' token
In file included from /usr/include/signal.h:26,
from lsapilib.c:52:
/usr/include/sys/signal.h:85: error: parse error before "siginfo_t"
In file included from lsapilib.c:52:
/usr/include/signal.h:111: error: parse error before "siginfo_t"
/usr/include/signal.h:113: error: parse error before "siginfo_t"
make: *** [lsapilib.o] Error 1
In file included from /usr/include/sys/signal.h:34,
from /usr/include/signal.h:26,
from lsapilib.c:52:
/usr/include/sys/siginfo.h:259: error: parse error before "ctid_t"
/usr/include/sys/siginfo.h:292: error: parse error before '}' token
/usr/include/sys/siginfo.h:294: error: parse error before '}' token
/usr/include/sys/siginfo.h:390: error: parse error before "ctid_t"
/usr/include/sys/siginfo.h:392: error: conflicting types for `__proc'
/usr/include/sys/siginfo.h:261: error: previous declaration of `__proc'
/usr/include/sys/siginfo.h:398: error: conflicting types for `__fault'
/usr/include/sys/siginfo.h:267: error: previous declaration of `__fault'
/usr/include/sys/siginfo.h:404: error: conflicting types for `__file'
/usr/include/sys/siginfo.h:273: error: previous declaration of `__file'
/usr/include/sys/siginfo.h:420: error: conflicting types for `__prof'
/usr/include/sys/siginfo.h:287: error: previous declaration of `__prof'
/usr/include/sys/siginfo.h:424: error: conflicting types for `__rctl'
/usr/include/sys/siginfo.h:291: error: previous declaration of `__rctl'
/usr/include/sys/siginfo.h:426: error: parse error before '}' token
/usr/include/sys/siginfo.h:428: error: parse error before '}' token
/usr/include/sys/siginfo.h:432: error: parse error before "k_siginfo_t"
/usr/include/sys/siginfo.h:437: error: parse error before '}' token
In file included from /usr/include/signal.h:26,
from lsapilib.c:52:
/usr/include/sys/signal.h:85: error: parse error before "siginfo_t"
In file included from lsapilib.c:52:
/usr/include/signal.h:111: error: parse error before "siginfo_t"
/usr/include/signal.h:113: error: parse error before "siginfo_t"
make: *** [lsapilib.o] Error 1

Anybody have any ideas? I'd really like to test this for our Ruby sites.
 
#3
Looks like it's using the GCC compiler package I installed. It's gcc 3.3.2 on Intel Solaris. Should I be using something else and if so how do I set that when doing a gem install?
 

mistwang

LiteSpeed Staff
#4
Our gcc is 3.4.2, gcc command is in /opt/csw/gcc3/bin/gcc.
The error is completely in the system header files. I think it is compiler environment issue.
 
#6
Ok, I figured out the compile problems. It looks like it was because I was using Blastwave ruby and gem packages. I grabbed the Sun compiler and everything compiles fine now. I've been away from Solaris for a long time so I'm slowly getting back up to speed. I'm still having problems running rails apps though. I create a fresh rails app and verify that it works ok by running the built in WEBrick server and everything comes up fine. Then I use the rails template and I get nothing. I can hit the rails index.html page just fine but if I try to hit a dynamic page it just hangs. When I look at the process list I see a couple of RubyRunner.rb processes, but the browser just sits there waiting for a response. I don't see anything in the logs so I'm not sure what else to look at.

I appreciate your help and I'd really like to use litespeed for our production environment because I hate the idea of using Apache/Mongrel in prod. Just seems like a configuration nightmare.
 
#8
Ok, I've tried installing Ruby and gems from source and still no luck. I'm determined to make this work because I really don't want to use Apache/Mongrel or even LS/Mongrel for that matter. Quick recap on where I am in my latest attempt.

I installed Solaris 10u2. I installed the Sun compiler and did a gem install ruby-lsapi. Other than a few warnings about undeclared methods the compile went fine. A C programmer in the office told me those are fine and if they were serious it wouldn't compile. I created a test rails site and made sure it could connect to a test database server on another box (using rake db:migrate). When I hit the rails site in a browser the index.html page loads fine but when I try and hit a dynamic page it comes back with a 503. So I ran RailsRunnber.rb from the command line, changing the first require line to point to my rails app and it starts and runs just fine. No errors except for the error below.

warning: already initialized constant ENV

In fact that is the only error message in any of the logs. So it appears to me that the lsapi and RailsRunner are working ok, although I'm not sure how to test the RailsRunner other than to look for errors when running it on the command line. Any thoughts on where to go from here?
 

mistwang

LiteSpeed Staff
#9
You can try a default Rails application without DB involved first. run in development mode and check Rails' log file as well.

Also, you need to pay attention about the "Process Limits" and "memory limits" under "Rails" tab as well as "security" tab, increase them to a higher value.

LSAPI is working fine when you see that warning message, it is safe to ignore that error message.
 
#10
I'm using a freshly created rails app. I only changed the database.yml file to point to a real database to rule out that the app wasn't hanging because it was trying to use a database. I upped the default time outs to 120, but everything else is the default settings and a fresh rails app should be well under that. Also, I did a netstat -na and I see /tmp/lshttpd/railstest:_.sock which is obviously the socket that the RailsRunner is using, but for whatever reason it just won't run the rails app. Could there be something blocking the communication between the RailsRunner and LS?
 

mistwang

LiteSpeed Staff
#11
Please make sure "ruby path" has been set properly,
"Memory Soft/Hard Limit" and "Process Soft/Hard Limit" has been set high enough under both "Rails" and "Security" tab.
If you server is reachable over internet, I can take a look for you.
 
#12
Thanks for all your help! I was able to compile it and finally get it working with gcc 3.4.5 from blastwave. Everything is working great now. Thanks again!
 
Top