简体   繁体   English

具有RVM的本地OS X开发人员计算机上的passenger-install-apache2-module问我要安装其他红宝石吗?

[英]passenger-install-apache2-module on local OS X dev machine with RVM is asking me to install a different ruby?

I have a working Rails install on RVM on my OS X dev machine running on Ruby 1.9.2-p180 currently. 我目前在运行在Ruby 1.9.2-p180上的OS X开发机上的RVM上安装了可运行的Rails。 I'm looking to switch over to Passenger locally to have multiple apps running simultaneously and improve my skills administering Passenger on a non-production box. 我希望在本地切换到“乘客”,以同时运行多个应用程序,并提高在非生产设备上管理“乘客”的技能。

I've successfully installed the Passenger gem, and am now at the stage where I should run: 我已经成功安装了Passive gem,现在处于运行状态:

rvm passenger-install-apache2-module

but I'm getting this message after running it: 但是我在运行它后收到此消息:

WARN: ruby ruby-1.9.2-p180-module is not installed. 警告:未安装ruby ruby​​-1.9.2-p180-module。

To install do: 'rvm install ruby-1.9.2-p180-module' 要安装执行:'rvm install ruby​​-1.9.2-p180-module'

running that command installs a whole different ruby, where the passenger install command still doesn't seem to work (I install all the gems I need for this new ruby version, then running rvm passenger-install-apache2-module just does nothing). 运行该命令会安装一个完全不同的ruby,而passport install命令似乎仍然无法正常工作(我安装了此新ruby版本所需的所有gem,然后运行rvm passenger-install-apache2-module则无济于事)。

Any thoughts? 有什么想法吗? I have yet to get RVM working perfectly on my dev machine, staging server, or production server, so I'm not sure if its just me not understanding how to do all this stuff (I pretty much follow tutorials for most things Rails related) or what. 我还没有使RVM在我的开发机,登台服务器或生产服务器上完美运行,所以我不确定是否只是我不了解如何做所有这些事情(我几乎遵循与Rails相关的大多数事情的教程)要不然是啥。

You're using RVM incorrectly. 您使用的RVM错误。 Just run passenger-install-apache2-module , not rvm passenger-install-apache2-module . 只需运行passenger-install-apache2-module ,而不是rvm passenger-install-apache2-module The former runs the command directly, the latter is for telling RVM to switch the currently active Ruby interpreter to one named passenger-install-apache2-module which doesn't make any sense. 前者直接运行命令,后者用于告诉RVM将当前活动的Ruby解释器切换到一个没有任何意义的命名为passenger-install-apache2-module

Hmm...not sure. 嗯...不确定。 What I personally do is install RVM first and install a Ruby version and all needed gems, and THEN run the passenger install. 我亲自做的是首先安装RVM并安装一个Ruby版本和所有需要的宝石,然后再运行安装乘客。 Looks like you're on the right track as far as the Passenger install goes, step one is running 'sudo gem install passenger,' step two is sudo passenger-install-apache2-module', and step three is copying the lines that the prompt gives you to your httpd.conf file at /private/etc/apache2/httpd.conf. 就乘客安装而言,您似乎处在正确的轨道上,第一步正在运行“ sudo gem install乘客”,第二步是sudo passenger-install-apache2-module,而第三步是复制提示符将您带到/private/etc/apache2/httpd.conf中的httpd.conf文件。 (NOTE: If you're using RVM, don't run 'sudo' on those commands.) (注意:如果您使用的是RVM,请不要在这些命令上运行'sudo'。)

Maybe I would try getting RVM up and running with a Ruby version (Ruby Enterprise Edition 1.8.7 is my recommendation), then trying the Passenger install. 也许我会尝试使用Ruby版本(建议使用Ruby Enterprise Edition 1.8.7)启动RVM并运行,然后尝试安装Passenger。

Another note that has tripped me up a few times...watch out if you ever change or upgrade your Ruby through RVM after Passenger is installed...you may need to update those lines in httpd.conf accordingly. 另一个使我绊倒的音符...请注意,如果在安装“乘客”后通过RVM更改或升级Ruby,则可能需要相应地更新httpd.conf中的那些行。

In addition, if you didn't know already there is a preference pane for Mac OS X that you can install (don't have the URL handy, Google for it) to manage your Passenger projects. 此外,如果您还不知道Mac OS X的偏好设置面板,可以安装该面板(没有方便使用的URL,Google可以管理您的乘客项目)。 Unfortunately it's only 32-bit which is a minor annoyance on 64-bit Macs (the system preferences has to relaunch). 不幸的是,它只有32位,这在64位Mac上是个小麻烦(必须重新启动系统偏好设置)。

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

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