Trying to install Ruby for a Mastodon installation. But I get this message:
Anyone any ideas?
Thx!
[mastodon@localhost ~]$ rvm install 2.6
Searching for binary rubies, this might take some time.
No binary rubies available for: centos/7/x86_64/ruby-2.6.3.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for centos.
Installing requirements for centos.
Installing required packages: ruby..mastodon password required for 'yum install -y ruby':
.
Error running 'requirements_centos_libs_install ruby',
please read /opt/mastodon/.rvm/log/1582485939_ruby-2.6.3/package_install_ruby.log
Requirements installation failed with status: 1.
When tying to install the referenced package I see it is already installed:
Package libyaml-devel-0.1.4-11.el7_0.x86_64 already installed and latest version
Opening the suggested log give me this:
[2020-02-23 20:25:39] requirements_centos_libs_install
requirements_centos_libs_install ()
{
__rvm_try_sudo yum install -y "$@" || return $?
}
current path: /opt/mastodon
PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/mastodon/.rvm/bin:/opt/mastodon/.local/bin:/opt/mastodon/bin
command(2): requirements_centos_libs_install ruby
++ __rvm_try_sudo yum install -y ruby
++ typeset -a command_to_run
++ typeset sudo_path sbin_path missing_paths
++ command_to_run=("$@")
++ (( UID == 0 ))
++ case "$rvm_autolibs_flag_number" in
++ is_a_function __rvm_sudo
++ typeset -f __rvm_sudo
++ missing_paths=
++ for sbin_path in /sbin /usr/sbin /usr/local/sbin
++ [[ -d /sbin ]]
++ [[ :/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/mastodon/.rvm/bin:/opt/mastodon/.local/bin:/opt/mastodon/bi$
++ missing_paths+=:/sbin
++ for sbin_path in /sbin /usr/sbin /usr/local/sbin
++ [[ -d /usr/sbin ]]
++ [[ :/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/mastodon/.rvm/bin:/opt/mastodon/.local/bin:/opt/mastodon/bi$
++ for sbin_path in /sbin /usr/sbin /usr/local/sbin
++ [[ -d /usr/local/sbin ]]
++ [[ :/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/mastodon/.rvm/bin:/opt/mastodon/.local/bin:/opt/mastodon/bi$
++ [[ -n :/sbin ]]
++ command_to_run=(/usr/bin/env PATH="${PATH}${missing_paths}" "${command_to_run[@]}")
++ command_to_run=(__rvm_sudo -p "%p password required for '$*': " "${command_to_run[@]}")
++ __rvm_sudo -p '%p password required for '\''yum install -y ruby'\'': ' /usr/bin/env PATH=/usr/local/bin:/bin:/usr/bin:/usr/$
++ command sudo -p '%p password required for '\''yum install -y ruby'\'': ' /usr/bin/env PATH=/usr/local/bin:/bin:/usr/bin:/us$
++ sudo -p '%p password required for '\''yum install -y ruby'\'': ' /usr/bin/env PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/$
mastodon is not in the sudoers file. This incident will be reported.
++ return 1
++ return 1
Can you try this as the “mastodon” user, not root?
You need to setup sudo to let you switch from the mastodon user to root without a password properly. Please follow the guide and understand security repercussions of this.
You need to setup sudo to let you switch from the mastodon user to root without a password properly. Please follow the guide and understand security repercussions of this.
I’m using an SSH key to login over SSH. Would this be interfering? I’m running a webserver as well next to this.
No, that’s how everybody is doing this. You need to setup sudo properly. I think you did not follow the guide precisely and therefore you might run into trouble like this.
It is okay but you need to be consistent. The guide is written for a normal user (in your case “mastodon”) which has sudo privileges to switch to root when necessary. Please fix this and your rvm will run fine. Use the sudo guide mentioned already How to Use Sudo on Debian, CentOS, and FreeBSD - Vultr.com .
If your run into trouble with this, check sudo -l as the mastodon user again.