2012-12-02 192 views
0

我正在設置我的VPS來部署我的rails應用程序,但拒絕權限錯誤一直在我的服務器端發生。我不得不重新安裝Perl和捲曲的,現在我得到如下:安裝rbenv,權限被拒絕

[email protected]:~$ rbenv bootstrap-ubuntu-12-04 
bash: /usr/bin/python: permission denied 

我嘗試重新安裝蟒蛇,但沒有成功走了過來。我應該如何解決它?

更新:

[email protected]:/home/deployer# cd /usr 
[email protected]:/usr# cd bin 
[email protected]:/usr/bin# cd python 
bash: cd: python: not a directory 

這是否意味着蟒蛇安裝不正確?

更新:

[email protected]:~$ ls -l 'which python' 
total 0 
[email protected]:~$ python 
bash: /usr/bin/python: permission denied 

我認爲,這表示蟒蛇安裝不正確,所以我計算了以下

[email protected]:~$ su root 
[email protected]:/home/deployer# apt-get install python 
python package is already the latest version 

所以我沒能找到解決辦法呢。

+0

什麼是'ls -l \'哪個python \''輸出?你可以運行'python',會發生什麼? – soulseekah

+0

@soulseekah,請檢查更新。 –

+0

'哪個python'必須不被引用,從我的評論拷貝。 – soulseekah

回答

1

事實證明這是一個權限問題,以下是一些關於如何調試試圖在這種情況下要執行的二進制,pythonpermission denied錯誤的一般提示:

ls -l `which python` - 嘗試檢索完整路徑和權限,如-rwxr-xr-x 1 nobody nobody 9644 2012-12-02 13:15 /tmp/env/bin/python

例如,如果權限爲0000,則必須以特權用戶身份運行。

sudo chmod 0755 /usr/bin/python通常有幫助。