简体   繁体   English

在Apache + Passenger 3.0.7下运行我的Rails应用程序时遇到分段错误

[英]Encountered segmentation fault when running my rails app with apache + passenger 3.0.7

My rails app with apache + passenger works just fine at the beginning. 我的带有Apache + Passenger的Rails应用程序在一开始就很好用。 However, after running for a while, I encountered following error: 但是,运行一段时间后,遇到以下错误:

The application spawner server exited unexpectedly: Unexpected end-of-file detected.

I checked the apache error log, found this error: 我检查了apache错误日志,发现此错误:

../gems/passenger-3.0.7/lib/phusion_passenger/utils.rb:716: [BUG] Segmentation fault

Seems the Passenger has memory issue. 乘客似乎有记忆问题。

Anyone can help? 有人可以帮忙吗? Thanks. 谢谢。

The most likely cause is a bug in the version of the ruby interpreter that passenger is using. 最可能的原因是乘客使用的红宝石解释器版本中的错误。 You may want to upgrade the version of ruby that passenger is running. 您可能要升级乘客正在运行的红宝石版本。 If you're currently using the system ruby provided by your distro, you may want to install a rvm in multi-user mode, or rbenv to use a more recent version. 如果您目前正在使用你的发行版提供的系统红宝石,你可能需要安装一个RVM在多用户模式,或rbenv使用最新版本。

There are also much newer versions of passenger available. 也有很多新版本的乘客可用。 I would upgrade both ruby and passenger to see if that resolves it; 我将同时升级红宝石和乘客,以查看是否能够解决该问题; most likely the issue has been found and fixed in newer versions. 最有可能已发现该问题,并已在较新版本中修复该问题。

I once had this error where the versions of Ruby and Passenger were out of sync. 我曾经遇到过这样的错误,即Ruby和Passenger的版本不同步。

I use RVM to manage my Ruby versions. 我使用RVM管理我的Ruby版本。 I had updated Ruby, but not passenger. 我已经更新了Ruby,但没有更新。 I had to update / reinstall passenger and then update my Apache configuration to use the new passenger gem. 我必须更新/重新安装乘客,然后更新我的Apache配置以使用新的乘客gem。

Also, which OS are you running this on? 另外,您正在哪个操作系统上运行它? If it's a linux distro, I'd recommend installing rvm (apt-get or yum depending on your distro). 如果是Linux发行版,建议安装rvm(取决于您的发行版为apt-get或yum)。 Then upgrade to the latest ruby (I'm assuming you're on 1.9.3). 然后升级到最新的红宝石(假设您使用的是1.9.3)。 Use bundler to install rails and even passenger (would recommend version 4 of passenger). 使用捆绑器安装导轨,甚至安装乘客(建议使用乘客的版本4)。 Or, you can install passenger just using gem install. 或者,您可以仅使用gem install安装乘客。

Either way, it will install a script to configure apache for you. 无论哪种方式,它都会安装一个脚本来为您配置apache。 Again, depending on your distro, this can be set up different ways. 同样,根据您的发行版,可以采用不同的方式进行设置。 So, for example, you might run: rvmsudo passenger-install-apache2-module. 因此,例如,您可以运行:rvmsudo passenger-install-apache2-module。

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

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