Installing passenger in production environment
I have managed to install ruby 1.9.2 with rvm and rails,, but am having some trouble getting passenger installed. I have the source files in my /opt directory. When I run sudo ./passenger-install-nginx-module in the passenger bin directory I get this error: /usr/bin/env: ruby: No suc开发者_如何学运维h file or directory
rvm info:
Ruby Path "/home/me/.rvm/rubies/ruby-1.9.2-p180/bin/ruby"
Use rvmsudo instead of sudo to run the passenger install command. Also, you may need to specify the full path to that command. On my server it's something like this:
rvmsudo /usr/local/rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.11/bin/passenger-install-apache2-module
You should be able to generate an RVM wrapper script (shell script to select RVM ruby):
rvm wrapper default_192
...and then set PassengerRuby in your Passenger config (tell Passenger which ruby to use):
PassengerRuby /home/your_user/.rvm/bin/default_192
if ever you find yourself wondering why your vagrant box has suddenly stopped loading your website, and you have the passenger gem installed, there's a big possibility that it has automatically upgraded the gem and needs you to make a few changes to the apache module for it. This is just one issue I have come across.
So in light of sharing the knowledge just open the following file for editing on the command using your preferred editor if you're running apache.
/etc/apache2/conf.d/passenger
and replace the three lines with the following:
. LoadModule passenger_module /var/lib/gems/1.9.1/gems/passenger-4.0.10/buildout/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/1.9.1/gems/passenger-4.0.10
PassengerDefaultRuby /usr/bin/ruby1.9.1
we're basically replacing the version number the module should use.
精彩评论