Passenger installation with nginx fails

2019-02-02 07:37发布

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?

7条回答
ら.Afraid
2楼-- · 2019-02-02 07:57

I got it working with

rvmsudo `which passenger-install-nginx-module`
查看更多
可以哭但决不认输i
3楼-- · 2019-02-02 07:58

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楼-- · 2019-02-02 07:59

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楼-- · 2019-02-02 08:02

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.

查看更多
Lonely孤独者°
6楼-- · 2019-02-02 08:03

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

查看更多
Lonely孤独者°
7楼-- · 2019-02-02 08:12

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,

查看更多
登录 后发表回答