What is the passenger_free_ruby executable that is installed by the apt passenger package
Asked Answered
C

1

5

How does passenger_free_ruby work?

I installed phusion passenger using the apt package provided by phusion. My system ruby is ruby2.1 installed using the brightbox apt packages. I would expect /etc/apache2/mods-enabled/passenger.conf to use /usr/bin/ruby as the default value of PassengerDefaultRuby. It uses /usr/bin/passenger_free_ruby.

passenger_free_ruby acts like ruby and it is the expected ruby

/usr/bin/passenger_free_ruby -v
ruby 2.1.6p336 (2015-04-13 revision 50298) [x86_64-linux-gnu]

If I upgrade ruby to ruby2.2 then passenger_free_ruby runs as the ruby2.2

/usr/bin/passenger_free_ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux-gnu]

So what does passenger_free_ruby actually do? What does free mean? Why not just use /usr/bin/ruby as the default ruby?

Casablanca answered 20/8, 2015 at 5:34 Comment(0)
I
8

The reason for its existance is documented in the executable's source code.

/*
 * This is a simple program for executing either the 'ruby' command in PATH,
 * or one of the Ruby versions installable by APT. This is necessary because
 * Debian 6 and Debian 8 (among others) do not install /usr/bin/ruby upon
 * installing one of the versioned Ruby packages (e.g. apt-get install ruby2.1).
 * Commands such as 'passenger' are supposed to be runnable under any Ruby
 * interpreter the user desires, including non-APT-installed Rubies, but we can't
 * just set the shebang line to '#!/usr/bin/env ruby'. This problem is solved by
 * setting the shebang line to '#!/usr/bin/passenger_default_ruby'.
 */
Inofficious answered 21/8, 2015 at 11:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.