Unknown directive "passenger_enabled"

Hey all, so I’m trying to deploy a Ruby on Rails app.

According to this documentation here, I am supposed to put
passenger_enabled on;
passenger_ruby /usr/bin/ruby;

in my server block – so essentially it’s supposed to look like this:

Every time I try to restart Nginx, I am met with this error:

I do have passenger and nginx installed - I verified with the $ whereis command:

I have tried just about everything including:

  1. un-installing nginx and passenger several times and re-installing in different orders
  2. installing the passenger gem and removing the dnf version of passenger
  3. downgrading from F30 to F29 in hopes that it was simply a glitch/bug in F30 that was causing the passenger_enabled command not to be recognized
  4. scouring the internet for an answer - which I have obviously not been successful on - hence the reason I am here.

I am at a loss as to how to fix this. Please help!

Well, researching this has been a rather interesting rabbit hole…

Okay, so apparently before nginx supported dynamic modules, passenger shipped a custom version of nginx with built-in support for these directives. Now nginx does have dynamic modules, so passenger just ships a dynamic module.

After figuring this out, my first thought was that it must not be loading for some reason. I went to look in the passenger rpm contents for the module path to load it and…it wasn’t there.

This is where things get a bit confusing… I checked the passenger spec file and found some interesting comments:

# Remove object files and source files. They are needed to compile nginx
# using "passenger-install-nginx-module", but it's not according to
# guidelines. Debian does not provide these files too, so we stay consistent.
# In the long term, it would be better to allow Fedora nginx to support
# Passenger.
rm -rf %{buildroot}%{passenger_libdir}/ngx_http_passenger_module
rm -rf %{buildroot}%{passenger_libdir}/ruby_extension_source
rm -rf %{buildroot}%{passenger_libdir}/include
rm -rf %{buildroot}%{_libdir}/%{name}/common
rm -rf %{buildroot}%{_bindir}/passenger-install-*-module
# nginx support if use compiles nginx himself with Passenger support.
ln -s %{_sbindir}/nginx %{buildroot}%{passenger_archdir}/PassengerWebHelper

Assuming that the last comment has a typo of “use” → “user”, it would seem that you’re expected to build nginx with passenger support yourself. No indication is made as to whether this is supposed to be the older, static method, or newer, dynamic method. (Is the older still even supported?) However, there is a directory present named “nginx_dynamic”, which would imply that there’s some sort of pre-compiled nginx dynamic support to begin with.

This is where I ran out of steam. My suggestions would be:

  • File a bug report for the passenger package for this mess, IMO there should either be a separate package for this module or the directions should be clearer.
  • Meanwhile, there seems to be an alternative RPM repository by Ulyaoth that has support for the nginx module. I’m not sure how the quality of this repository is, but it could be something to check out.

Best of luck, sorry there was no simple answer here.

1 Like

Ah well, thank you for all your effort and research. You have been most kind. :blush:

I will be switching technologies from Ruby on Rails to Django. :neutral_face:
My hopes are that deploying Django will be less painless.