2012-12-12 28 views
6

我只是试图安装我的第一台Rails服务器 - 在Ubuntu 12.04上。我安装了rbenv(作为用户:deployer与组sudo和管理员)。现在试图根据他们的文档安装乘客。rbenv和乘客 - 不能从非root用户帐户安装(sudo组)

我跑passenger-install-nginx-module它启动,但然后我得到

Please specify a prefix directory [/opt/nginx]: 

-------------------------------------------- 

Permission problems 

This installer must be able to write to the following directory: 

/opt/nginx 

But it can't do that, because you're running the installer as deployer. 

好吧,我跑sudo passenger-install-nginx-module话,并获得sudo: passenger-install-nginx-module: command not found

是否意味着我必须以root用户身份安装它,为root用户安装整个rbenv,然后安装乘客?我读过的每个教程都是从非root用户帐户运行的:/,它对我不起作用。

+2

不,作为您的部署者用户运行''哪个passenger-install-nginx-module''来获取乘客脚本的完整路径,然后运行'su''并运行带有完整路径的命令。您只需要一次该脚本;) – 23tux

+0

谢谢,它正在工作。发布它作为答案,以便我可以批准它。 –

回答

18

正如我在我的评论中写的,你必须以完整路径的root身份运行passenger-install-nginx-module,因为它不在你的bash的$PATH var中。要找到路径,请运行which passenger-install-nginx-module

+8

总之:'sudo \'其中passenger-install-nginx-module \'' –

相关问题