一个奇怪的Phusion Passenger安装错误:EXCEPTION:没有这样的文件或目录(Errno :: ENOENT)

时间:2014-07-11 00:56:30

标签: ruby-on-rails ruby passenger

我试图在Ruby on Rails应用程序中安装Phusion Passenger,如下所示:

su -
gem install passenger
export HTTPD=/usr/local/apache2/bin/httpd
export APXS2=/usr/local/apache2/bin/apxs
export APR_CONFIG=/usr/local/apr/bin/apr-1-config
export APU_CONFIG=/usr/local/apr/bin/apu-1-config
passenger-install-apache2-module

然后我收到一条错误消息:

EXCEPTION: No such file or directory - /usr/local/apache2/bin/apxs (Errno::ENOENT)

我确认它是否属实,但确定它确实存在。

ls -l /usr/local/apache2/bin/apxs
-rwxr-xr-x. 1 root root 23540 Jul  9 06:41 /usr/local/apache2/bin/apxs

这是什么意思?我无法找到接下来要做的事情。 请帮忙!

环境:虚拟框和流浪汉

操作系统:CentOS-6.5

ruby​​:2.1.2

我看到的错误消息和堆栈跟踪是这样的:

Sanity checking Apache installation...
--------------------------------------------
*** EXCEPTION: No such file or directory - /usr/local/apache2/bin/apxs (Errno::ENOENT)
    /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/lib/phusion_passenger/platform_info/apache.rb:508:in ``'
    /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/lib/phusion_passenger/platform_info/apache.rb:508:in `apache2_sbindir'
    /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/lib/phusion_passenger/platform_info.rb:115:in `apache2_sbindir'
    /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/lib/phusion_passenger/platform_info/apache.rb:462:in `find_apache2_executable'
    /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/lib/phusion_passenger/platform_info/apache.rb:64:in `apache2ctl'
    /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/lib/phusion_passenger/platform_info.rb:115:in `apache2ctl'
    /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/lib/phusion_passenger/platform_info/apache_detector.rb:133:in `block in detect_one'
    /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/lib/phusion_passenger/platform_info/apache_detector.rb:226:in `add_result'
    /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/lib/phusion_passenger/platform_info/apache_detector.rb:118:in `detect_one'
    /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/lib/phusion_passenger/platform_info/apache_detector.rb:112:in `block in detect_all'
    /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/lib/phusion_passenger/platform_info/apache_detector.rb:111:in `each'
    /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/lib/phusion_passenger/platform_info/apache_detector.rb:111:in `detect_all'
    /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/bin/passenger-install-apache2-module:195:in `check_whether_there_are_multiple_apache_installs'
    /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/bin/passenger-install-apache2-module:127:in `run_steps'
    /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/lib/phusion_passenger/abstract_installer.rb:71:in `run'
    /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.45/bin/passenger-install-apache2-module:863:in `<top (required)>'
    /usr/local/bin/passenger-install-apache2-module:23:in `load'
    /usr/local/bin/passenger-install-apache2-module:23:in `<main>'

1 个答案:

答案 0 :(得分:0)

我现在已经理解了原因。

也必须导出LD_LIBRARY_PATH。

毕竟,我成功建立了阿帕奇和乘客。

yum -y install pcre-devel.x86_64
cd /usr/local/src
wget http://ftp.riken.jp/net/apache//httpd/httpd-2.4.9.tar.gz
wget http://ftp.kddilabs.jp/infosystems/apache//apr/apr-1.5.1.tar.gz
wget http://ftp.kddilabs.jp/infosystems/apache//apr/apr-util-1.5.3.tar.gz
tar xvfz httpd-2.4.9.tar.gz
tar xvfz apr-1.5.1.tar.gz
tar xvfz apr-util-1.5.3.tar.gz
mv apr-1.5.1      /usr/local/src/httpd-2.4.9/srclib/apr
mv apr-util-1.5.3 /usr/local/src/httpd-2.4.9/srclib/apr-util
cd /usr/local/src/httpd-2.4.9
./configure --with-included-apr --enable-mods-shared=all --enable-mpms-shared=all --enable-modules=all --enable-ssl  --with-pcre=/usr/bin/pcre-config
make
make install
yum -y install curl-devel
gem install passenger
export HTTPD=/usr/local/apache2/bin/httpd
export APXS2=/usr/local/apache2/bin/apxs
export APR_CONFIG=/usr/local/apache2/bin/apr-1-config
export APU_CONFIG=/usr/local/apache2/bin/apu-1-config
export LD_LIBRARY_PATH=/usr/local/apache2/lib:$LD_LIBRARY_PATH
passenger-install-apache2-module