问题描述
我今天的大部分时间都在尝试解决以下问题:由于json gem中存在段错误,融合乘客无法处理请求.
I have spent the better half of today trying to resolve an issue where fusion passenger fails to process the request due to some segment fault issue within the json gem.
关于此问题,也有类似的帖子,但是这些解决方案似乎都没有用.我试图清除宝石并重新捆扎,例如gemset为空,捆绑安装.
There have been similar posts regarding this issue, however none of the solutions have appeared to work. I have tried to clear the gems and re bundle, e.g. gemset empty, bundle install.
有趣的是,可以运行Rails服务器,并且单独运行融合乘客也很好,只有在nginx下运行时,我才有这个问题.
The interesting this about this is running rails server is ok, and running fusion-passenger stand alone is fine too, only when running under nginx do I have this issue.
/usr/local/rvm/gems/ruby-2.0.0-p481/gems/json-1.8.1/lib/json/common.rb:67: [BUG] Segmentation fault
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
Web application could not be started
An error occurred while starting up the preloader. It exited before signalling successful startup back to Phusion Passenger. Please read this article for more information about this problem.
原始过程输出:
/usr/local/rvm/gems/ruby-2.0.0-p481/gems/json-1.8.1/lib/json/common.rb:67: [BUG] Segmentation fault
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
推荐答案
我找到了问题并解决了. ngnix的默认值为ruby 1.9.3,已经安装了融合乘客版本.我仅通过rvm安装了一个版本为2.0.0的ruby.我要做的就是将Nginx配置文件设置为ruby包装器,一切都很好.世界再次成为幸福的地方!
I found the issue and resolved it. ngnix was defaulting to ruby 1.9.3, a version fusion passenger has installed. I only installed one version 2.0.0 of ruby through rvm. All i had to do was set the nginx config file to the ruby wrapper and all was good. The world is once again a happy place!
passenger_ruby /usr/local/rvm/wrappers/ruby-2.0.0-p481/ruby;
这篇关于在nginx上运行时json gem的融合乘客问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!