简体   繁体   English

安装RVM,在Debian 7上获取错误用户的Ruby不允许执行

[英]Installing RVM, Ruby on Debian 7 getting error user is not allowed to execute

I installed RVM as regular user (non-root) but when it comes to install Ruby 我以普通用户(非root用户)身份安装了RVM,但是在安装Ruby时

rvm install ruby

I got this error: 我收到此错误:

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:~$ 

before it was saying "xsma is not in the sudoers file. This incident will be reported. " and i solved it by adding xsmas in the sudoers file like this: "xsma ALL=(All:ALL) ALL" but it still comes out with another error: "Sorry, user xsma is not allowed to execute..." And i don't know how figure it out. 在说“ xsma不在sudoers文件中。将报告此事件。”之前,我通过在sudoers文件中添加xsmas来解决了该问题,例如:“ xsma ALL =(All:ALL)ALL”,但仍然会出现另一个错误:“对不起,用户xsma不允许执行...”而且我不知道如何解决。 please help! 请帮忙!

Here is /etc/sudouers file: 这是/ 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

when i execute groups i got only root 当我执行组时,我只有root

Maybe your user is not added to sudo correctly, try to write in sudoers like this: 也许您的用户未正确添加到sudo中,请尝试使用以下sudoer进行编写:

xsma ALL=(ALL:ALL) ALL xsma ALL =(全部:全部)全部

and check if it works with "sudo -i" in console 并检查它是否与控制台中的“ sudo -i”一起使用


So there are several ways you can solve this problem: 因此,有几种方法可以解决此问题:

1) make sudo for your user 1)为您的用户制作sudo
2) make aptitude update and aptitude upgrade with root rights (logged like root) 2)使用root权限进行aptitude更新和aptitude升级(像root一样记录)

Try to read this, maybe this will help you to configure sudoers right https://wiki.debian.org/sudo 尝试阅读一下,也许这会帮助您正确配置sudoers https://wiki.debian.org/sudo

Finally i worked it out by restarting. 最后,我通过重新启动解决了问题。 it seems that the system needed a restart in order to use the new config properly. 似乎系统需要重新启动才能正确使用新配置。

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

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