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

时间:2012-02-17 20:32:10

标签: ruby-on-rails apache apache2 passenger

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

sudo passenger-install-apache2-module

我明白了:

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

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

sudo apt-get install ruby1.8-dev

我用以下结果完成了这个

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.

所以当我跑:

sudo passenger-install-apache2-module

我得到同样的结果让我跑:

sudo apt-get install ruby1.8-dev

5 个答案:

答案 0 :(得分:13)

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

sudo apt-get install ruby1.9.1-dev

这对我有用。希望它有所帮助。

答案 1 :(得分:2)

安装缺少的标题后,返回到开头并重新编译乘客:

gem install passenger

答案 2 :(得分:2)

尝试卸载ruby1.9并安装ruby1.8,然后重新安装乘客宝石。这对我有用。

答案 3 :(得分:1)

首先安装软件包:

  • 对于Ubuntu:

    sudo apt-get install libcurl4-gnutls-dev
    sudo apt-get install apache2-dev
    
  • CentOS的
  • (好tutorial):

    yum install curl-devel apache2-devel 
    

安装gem后:

gem install passenger

并成功配置:

sudo passenger-install-apache2-module

答案 4 :(得分:0)

我发现,在乘客安装-apache2-module识别出更改后的配置之前,您需要注销一些Passenger,然后在安装后重新登录当前用户。