Passenger installation with nginx fails

扶醉桌前 提交于 2019-11-29 00:24:59

问题


I'm running an ubuntu 9.10 server on an amd-64 platform. Everything's pretty much standard, and I've got Sinatra 0.94 running on a ruby 1.8 installation. I want to install passenger in order to easily configure ssl.

The problem is, it fails to find the installer.

I run

sudo gem install passenger

or

sudo gem install -r passenger

and then the next line,

passenger-install-nginx-module

or

passenger-install-apache2-module

both fail because the path isn't found.

Is there something I'm forgetting here? Shouldn't it just work, straight up, once the gem is installed?


回答1:


A bit late for an answer I guess, but actually, the correct way of running the Phusion Passenger installer for nginx, when using RVM, is to use rvmsudo as in:

rvmsudo passenger-install-nginx-module

Credits go to this blog post,




回答2:


I got it working with

rvmsudo `which passenger-install-nginx-module`



回答3:


according to this issue on github: https://github.com/wayneeseguin/rvm/issues/1307

seems like you have to do full path:

this worked for me:

which passenger-install-nginx-module

rvmsudo ~/.rvm/gems/ruby-1.9.3-p327-new/gems/passenger-3.0.18/bin/passenger-install-nginx-module



回答4:


apparently, the gem is installed in a place that's off the path, according to

http://groups.google.com/group/phusion-passenger/browse_thread/thread/78ca12c4838034a6/b5a3c7a00a871283?lnk=gst&q=ubuntu+9.10#b5a3c7a00a871283

Frustrating error, which is why I leave this question rather than delete it (and, with the upvote, I think I'm not the only one with the problem).




回答5:


I had a similar issue. You need to add gems to your system PATH, paste this into your shell:

export PATH=$PATH:$HOME/bin:/var/lib/gems/1.8/bin

or, to make it permanent add it to your bashrc, usually here: ~/.bashrc

You can also execute just passenger-install-nginx-module by going to the directory at: /var/lib/gems/1.8/bin

Good luck!




回答6:


I know you already answered the question, but figured I'd chime in with a cent or two.

I recently did a similar nginx install, but chose to go with RVM for managing Ruby versions, which requires us to NOT use sudo.

I recommend this route because all versions of Ruby and all your gems are organized neatly in your home directory. Doing so will also require you to compile nginx manually, which certainly helps understand the pipes a little.

You can compile nginx manually using the "--add-module=/home/user/path_to_passenger_gem/ext," but you'll want to read up RVM's instructions very carefully...really, don't skip a line as they are very concise.

Here's a link to RVM's instructions:

http://rvm.beginrescueend.com/passenger/

and to the Nginx manual instructions (which you probably already skimmed).

http://www.modrails.com/documentation/Users%20guide%20Nginx.html#_installing_phusion_passenger_for_nginx_manually




回答7:


I have got a bit of information on my blog regarding setting up nginx with passenger (and ssl in this case). Perhaps it is of use since it goes through the whole process of recompiling nginx with options.



来源:https://stackoverflow.com/questions/2225881/passenger-installation-with-nginx-fails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!