简体   繁体   中英

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. 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:

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.

To install do: '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).

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.

You're using RVM incorrectly. Just run passenger-install-apache2-module , not 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.

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. 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. (NOTE: If you're using RVM, don't run 'sudo' on those commands.)

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.

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.

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. Unfortunately it's only 32-bit which is a minor annoyance on 64-bit Macs (the system preferences has to relaunch).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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