乘客无法识别本地安装的 gem,使用打包的 gem [英] Passenger does not recognize locally installed gem, works with packed gems

查看:57
本文介绍了乘客无法识别本地安装的 gem,使用打包的 gem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个生产服务器.我安装了Passenger,并且在大多数情况下都可以正常工作.但是,我总是必须将项目与宝石打包在一起.如果我不这样做,我会收到此错误消息:

This is a production server. I have Passenger installed and it works properly for the most part. However, I always have to pack the gems with the projects. If I don't, I get this error message:

Missing the Rails 2.3.8 gem. Please `gem install -v=2.3.8 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed. 

gem list --local 返回 rails 2.3.8 和 2.3.5,所以 gem 实际上没有丢失.由于我无法解决这个问题,我一直在每个项目中都包含 rails gem(结果是一个正常工作的应用程序).

gem list --local returns rails 2.3.8 as well as 2.3.5 so the gem is actually not missing. Since I could not resolve this issue, I keep including the rails gem in every project (which results is a properly working application).

有什么想法吗?

P.S 我确实尝试了错误消息的建议,我的配置要求我安装了 2.3.8

P.S I did try the suggestions of the error message, my config is asking for 2.3.8 which I have installed

推荐答案

确保您使用与 Passenger 相同的用户权限安装/运行 gem 命令.

Make sure you are installing/running the gem command with the same user permission as Passenger.

默认情况下,Passenger 在具有超级用户权限的 Apache 中运行.如果您键入 gem install,除非您是 root,否则 Gems 将保存在您的用户文件夹中.

By default, Passenger runs inside Apache which has superuser privileges. If you type gem install, the Gems will be saved in your user folder unless you are root.

这篇关于乘客无法识别本地安装的 gem,使用打包的 gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆