(I'd guess that it passenger becomes nobody if it finds that it is root).
So either way a fix is needed, either:-
1) Add PassengerDefaultUser www-data to passenger.conf
or
2) Add code to the package script, to set the ownership of environment.rb to www-data
#1 would seem to me to be the best solution as #2 is a little obscure if you're not familiar with passenger and how it works.
(I'd guess that it passenger becomes nobody if it finds that it is root). tUser www-data to passenger.conf
So either way a fix is needed, either:-
1) Add PassengerDefaul
or
2) Add code to the package script, to set the ownership of environment.rb to www-data
#1 would seem to me to be the best solution as #2 is a little obscure if you're not familiar with passenger and how it works.