微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ubuntu – apt passenger包安装的passenger_free_ruby可执行文件是什么

passenger_free_ ruby如何运作?

我使用phusion提供的apt包安装了phusion乘客.我的系统ruby是使用brightBox apt软件包安装的ruby2.1.我希望/etc/apache2/mods-enabled/passenger.conf使用/usr/bin/ruby​​作为PassengerDefaultRuby认值.它使用/usr/bin/passenger_free_ruby.

passenger_free_ruby就像ruby一样,是预期的ruby

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

如果我将ruby升级到ruby2.2,那么passenger_free_ruby就像ruby2.2一样运行

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

那么passenger_free_ruby实际上做了什么?自由是什么意思?为什么不使用/usr/bin/ruby​​作为认的ruby?

解决方法

其存在的原因记录于 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'.
 */

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐