passenger 5.0.26 with nginx deployment fix

We’re using passenger and nginx combo for our Rails application at production environment. After upgrading passenger to 5.0.26, We’re seeing errors from passenger about building the native support so file.

{% highlight ruby %} App 14490 stderr: [] trying to compile for the current user (deploy) and Ruby interpreter… App 14490 stderr: (set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable) App 14490 stderr: Warning: compilation didn’t succeed. To learn why, read this file: App 14490 stderr: /tmp/passenger_native_support-%@$#^^.log App 14490 stderr: [] not downloading because passenger wasn’t installed from a release package App 14490 stderr: [] will not be used (can’t compile or download) App 14490 stderr: –> Passenger will still operate normally. {% endhighlight %}

In the /tmp/passenger_native_support-%@$#^^.log file log, the error looks like:

{% highlight ruby %}

mkdir -p /usr/lib/buildout/ruby/ruby-version-linux

Encountered permission error, trying a different directory…

mkdir -p /home/deploy/.passenger/native_support/5.0.26/ruby-version-linux

cd /home/deploy/.passenger/native_support/5.0.26/ruby-version-linux

/usr/bin/ruby-version /usr/lib/src/ruby_native_extension/extconf.rb

/usr/bin/ruby-version: No such file or directory – /usr/lib/src/ruby_native_extension/extconf.rb (LoadError) {% endhighlight %}

In short, ruby_native_extension isn’t the correct folder, but as a temporary fix to get the compilation going you could just copy the necessary files there anyway, e.g.:

{% highlight ruby %}

sudo mkdir /usr/lib/src/
cp -dpR /usr/share/passenger-enterprise/ruby_extension_source /usr/lib/src/ruby_native_extension

{% endhighlight %}

We moved our machine to Unicorn as we’ve scope to migrate till now.

And if you get stuck… Ask Here

email me

Rajeev Sharma
Technical Lead

software entrepreneur and father of a fairy tale!!!.