[英]Installing RVM, Ruby on Debian 7 getting error user is not allowed to execute
我以普通用戶(非root用戶)身份安裝了RVM,但是在安裝Ruby時
rvm install ruby
我收到此錯誤:
xsma@ACS:~$ rvm install ruby
Searching for binary rubies, this might take some time.
Found remote file https://rvm.io/binaries/debian/7/i386/ruby-2.1.1.tar.bz2
Checking requirements for debian.
Installing requirements for debian.
Updating systemxsma password required for 'apt-get --quiet --yes update':
xsma password required for 'apt-get --quiet --yes update':
....
Error running 'requirements_debian_update_system ruby-2.1.1',
showing last 15 lines of /home/xsma/.rvm/log/1397842665_ruby-2.1.1/update_system.log
++ missing_paths+=:/usr/sbin
++ for sbin_path in /sbin /usr/sbin /usr/local/sbin
++ [[ -d /usr/local/sbin ]]
++ [[ ! :/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/xsma/.rvm/bin: =~ :/usr/local/sbin: ]]
++ missing_paths+=:/usr/local/sbin
++ [[ -n :/sbin:/usr/sbin:/usr/local/sbin ]]
++ command_to_run=(/usr/bin/env PATH="${PATH}${missing_paths}" "${command_to_run[@]}")
++ command_to_run=(${sudo_path}sudo -p "%p password required for '$*': " "${command_to_run[@]}")
++ sudo -p '%p password required for '\''apt-get --quiet --yes update'\'': ' /usr/bin/env PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/xsma/.rvm/bin:/sbin:/usr/sbin:/usr/local/sbin apt-get --quiet --yes update
Sorry, try again.
Sorry, user xsma is not allowed to execute '/usr/bin/env PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/xsma/.rvm/bin:/sbin:/usr/sbin:/usr/local/sbin apt-get --quiet --yes update' as root on ACS.ACS.
++ return 1
++ typeset __ret=1
++ case ${__ret} in
++ return 1
Requirements installation failed with status: 1.
xsma@ACS:~$
在說“ xsma不在sudoers文件中。將報告此事件。”之前,我通過在sudoers文件中添加xsmas來解決了該問題,例如:“ xsma ALL =(All:ALL)ALL”,但仍然會出現另一個錯誤:“對不起,用戶xsma不允許執行...”而且我不知道如何解決。 請幫忙!
這是/ etc / sudouers文件:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
xsma ALL=(All:ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
當我執行組時,我只有root
也許您的用戶未正確添加到sudo中,請嘗試使用以下sudoer進行編寫:
並檢查它是否與控制台中的“ sudo -i”一起使用
因此,有幾種方法可以解決此問題:
1)為您的用戶制作sudo
2)使用root權限進行aptitude更新和aptitude升級(像root一樣記錄)
嘗試閱讀一下,也許這會幫助您正確配置sudoers https://wiki.debian.org/sudo
最后,我通過重新啟動解決了問題。 似乎系統需要重新啟動才能正確使用新配置。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.