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

发布于 2025-01-06 12:42:42 字数 1321 浏览 6 评论 0原文

我有一个 RoR 应用程序需要托管在 Apache 上,所以我一直在尝试安装 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

I have a RoR app that needs to be hosted on Apache, so I have been trying to install Apache Passenger. When I run the following command:

sudo passenger-install-apache2-module

I get:

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

So it asked me to run the following command:

sudo apt-get install ruby1.8-dev

and I have done this with the following result

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.

So when I run:

sudo passenger-install-apache2-module

I get the same result asking me to run:

sudo apt-get install ruby1.8-dev

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

对不⑦ 2025-01-13 12:42:42

如果像我一样,您正在运行 apt 软件包 ruby​​1.9.1 而不是 1.8,那么请安装 ruby​​1.9.1-dev

sudo apt-get install ruby1.9.1-dev

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

If, like me, you are running the apt package ruby1.9.1 instead of 1.8 then install ruby1.9.1-dev instead

sudo apt-get install ruby1.9.1-dev

This worked for me. Hope it helps.

花之痕靓丽 2025-01-13 12:42:42

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

gem install passenger

After installing the missing headers, go back to the beginning and recompile passenger:

gem install passenger
孤寂小茶 2025-01-13 12:42:42

尝试卸载 ruby​​1.9 并安装 ruby​​1.8,然后重新安装乘客 gem。这对我有用。

Try uninstalling ruby1.9 and installing ruby1.8 instead then reinstall the passenger gem. This worked for me.

帅的被狗咬 2025-01-13 12:42:42

首次安装软件包:

  • 对于 Ubuntu:

    sudo apt-get install libcurl4-gnutls-dev
    sudo apt-get install apache2-dev
    
  • 对于 CentOS(很好 教程):

    yum install curl-devel apache2-devel 
    

安装 gem 后:

gem install passenger

并成功配置它:

sudo passenger-install-apache2-module

First install packages:

  • for Ubuntu:

    sudo apt-get install libcurl4-gnutls-dev
    sudo apt-get install apache2-dev
    
  • for CentOS (good tutorial):

    yum install curl-devel apache2-devel 
    

After install gem:

gem install passenger

And successfully configurate it:

sudo passenger-install-apache2-module
比忠 2025-01-13 12:42:42

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

I have found that with some Passenger requirements you need to log out of and then log back into the current user after you've installed them before passenger-install-apache2-module recognises the changed configuration.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文