简体   繁体   English

安装rbenv,权限被拒绝

[英]Installing rbenv, permission denied

I am setting up my VPS to deploy my rails app, but permission denied error keeps happening on my server side. 我正在设置我的VPS来部署我的rails应用程序,但是拒绝权限错误始终在服务器端发生。 I had to reinstall perl and curl, and now I'm getting the following: 我不得不重新安装perl和curl,现在得到以下信息:

deployer@max:~$ rbenv bootstrap-ubuntu-12-04
bash: /usr/bin/python: permission denied

I tried reinstalling python but came up with no success. 我尝试重新安装python,但没有成功。 How should I solve it? 我应该如何解决?

Update: 更新:

root@max:/home/deployer# cd /usr
root@max:/usr# cd bin
root@max:/usr/bin# cd python
bash: cd: python: not a directory

Does this mean python is not installed correctly? 这是否意味着python安装不正确?

Update: 更新:

deployer@max:~$ ls -l 'which python'
total 0
deployer@max:~$ python
bash: /usr/bin/python: permission denied

I thought this meant python was not installed correctly, so I computed the following 我以为这意味着python安装不正确,所以我计算出以下内容

deployer@d:~$ su root
root@d:/home/deployer# apt-get install python
python package is already the latest version

So I failed to find the solution yet. 所以我还没有找到解决方案。

As it turned out it was a permissions issue, here are some general tips on how to debug a permission denied error when trying to execute a binary, python in this case: 事实证明,这是一个权限问题,以下是一些有关如何在尝试执行二进制(在这种情况下为python时调试permission denied错误的常规提示:

ls -l `which python` - tries to retrieve full path and permissions, like -rwxr-xr-x 1 nobody nobody 9644 2012-12-02 13:15 /tmp/env/bin/python ls -l `which python`尝试检索完整路径和权限,例如-rwxr-xr-x 1 nobody nobody 9644 2012-12-02 13:15 /tmp/env/bin/python

Has to be run as a privileged user if permissions are 0000 , for example. 例如,如果权限为0000 ,则必须以特权用户身份运行。

sudo chmod 0755 /usr/bin/python usually helps. sudo chmod 0755 /usr/bin/python通常会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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