安装Apache Passenger,找不到Ruby开发标头

Wae*_*ara 5 apache ruby-on-rails apache2 passenger

我有一个需要在Apache上托管的RoR应用程序,所以我一直在尝试安装Apache Passenger.当我运行以下命令时:

sudo passenger-install-apache2-module
Run Code Online (Sandbox Code Playgroud)

我明白了:

Checking for required software...

 * GNU C++ compiler... found at /usr/bin/g++
 * Curl development headers with SSL support... found
 * OpenSSL development headers... found
 * Zlib development headers... found
 * Ruby development headers... not found
 * OpenSSL support for Ruby... found
 * RubyGems... found
 * Rake... found at /usr/local/bin/rake
 * rack... found
 * Apache 2... found at /usr/sbin/apache2
 * Apache 2 development headers... found at /usr/bin/apxs2
 * Apache Portable Runtime (APR) development headers... found at /usr/bin/apr-1-config
 * Apache Portable Runtime Utility (APU) development headers... found at /usr/bin/apu-1-config
Run Code Online (Sandbox Code Playgroud)

所以它让我运行以下命令:

sudo apt-get install ruby1.8-dev
Run Code Online (Sandbox Code Playgroud)

我用以下结果完成了这个

Reading package lists... Done
Building dependency tree       
Reading state information... Done
ruby1.8-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.
Run Code Online (Sandbox Code Playgroud)

所以当我跑:

sudo passenger-install-apache2-module
Run Code Online (Sandbox Code Playgroud)

我得到同样的结果要求我跑:

sudo apt-get install ruby1.8-dev
Run Code Online (Sandbox Code Playgroud)

mat*_*ttl 13

如果像我一样运行apt软件包ruby1.9.1而不是1.8,那么请安装ruby1.9.1-dev

sudo apt-get install ruby1.9.1-dev
Run Code Online (Sandbox Code Playgroud)

这对我有用.希望能帮助到你.


Mar*_*ton 0

我发现,对于某些 Passenger 要求,您需要先注销,然后在安装后重新登录到当前用户,然后再让 guest-install-apache2-module 识别更改的配置。