I've got a VPS over on slicehost that I've been wanting to try Phusion Passenger (aka mod_rails) on - considering they've released a version with an nginx module I figured that'd be the best shot. Worked perfectly as described on my OS X system, but on my Ubuntu Intrepid slice, I kept getting the following error:
c: In function 'pre_config_init':
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.0/ext/nginx/ngx_http_passenger_module.c:527: error: ignoring return value of 'system', declared with attribute warn_unused_result
make[1]: *** [objs/addon/nginx/ngx_http_passenger_module.o] Error 1
(among some others). The strange part was nginx would compile fine from the sources so it had to be the passenger module.
A little digging showed the CFLAGS option for -Werror was set, which typically will treat a warning as a failure. Considering this worked fine on the Mac, I'm guessing some aspect of Ubuntu was a bit pickier. Removing the -Werror in the CFLAGS worked as expected, but forced me to lose the slick automation that is setup in the package. The following is a little convoluted, but should do the job - please note, this assumes you already have gem installed and ready, along with all the necessary build tools.
- Login to your slice
- Run "sudo gem install passenger"
- Once finished, run "sudo passenger-install-nginx-module"
- When given the option, select the defaults - ideally, this will work perfectly for you the first time
- If it doesn't and you get an error similar to the above, rerun the "sudo passenger-install-nginx-module" command
- This time, when prompted select #2 for advanced users
- Point to the directory /tmp/nginx-0.6.36 for the nginx source
- Point to /opt/nginx or whichever directory you like for the installation location
- When given the option for additional configurations, enter the following (no quotes) "--with-cc-opt=-Wno-error"
- Allow the installation to compile and answer any remaining configuration options
At this point, the compilation should complete and install to the desired location. You can also simply run the compilation manually if you'd like other nginx modules to be enabled / etc. I haven't done much with this yet so there may be some errors left, but hopefully this will be of help to someone.