简体   繁体   English

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

[英]A strange Phusion Passenger installation error: EXCEPTION: No such file or directory(Errno::ENOENT)

I tried to install Phusion Passenger for Ruby on Rails application as bellow: 我试图在下面安装Phusion Passenger for Ruby on Rails应用程序:

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

Then I got an error message: 然后我收到一条错误消息:

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

I confirmed if it's true, but it was sure there it was. 我确认这是真的,但可以肯定的是。

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

What does this mean? 这是什么意思? I can't find what to do next. 我找不到下一步要做什么。 Please help! 请帮忙!

Environment: virtual box and vagrant 环境:虚拟盒子和无业游民

OS: CentOS-6.5 作业系统:CentOS-6.5

ruby: 2.1.2 红宝石:2.1.2

The error message and stack trace I saw were like this: 我看到的错误消息和堆栈跟踪如下:

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>'

I've understood the cause just right now. 我现在才知道原因。

LD_LIBRARY_PATH must be exported too. LD_LIBRARY_PATH也必须导出。

After all, I did success building apache and passenger. 毕竟,我在建立Apache和乘客方面取得了成功。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM