Installing Ruby package with AUR gives "Permission denied @ dir_s_mkdir - /root/.local"

When I try to update some ruby packages from AUR with pamac update I lately get a very annoying error. Please see the error message at the end of this post.

I googled around a little but what I found was primarily issued by Mac users having a similar error, but the solutions do not fit on my problem.
Actually, I don’t really understand, what exact problem is. The directory /root/.local already exists, and I am running pamac update with superuser credentials, so it should be read- and writable. Is this a problem with this particular AUR package? I wonder if I am the only one who has this problem, because I didn’t found any other question regarding it. Or I am the only one ignorant enough to not being able to solve it on their own. :sweat_smile:

Thanks in advance for any help!

And here is the error message:

Create ruby-chunky_png...
Running as unit: run-u799.service
Press ^] three times within 1s to disconnect TTY.
==> Making package: ruby-chunky_png 1.4.0-1 (Mo 03 Jun 2024 20:24:32 CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading chunky_png-1.4.0.gem...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  354k  100  354k    0     0  2805k      0 --:--:-- --:--:-- --:--:-- 2813k
==> Validating source files with sha512sums...
    chunky_png-1.4.0.gem ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
==> Entering fakeroot environment...
==> Starting package()...
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ dir_s_mkdir - /root/.local
        /usr/lib/ruby/3.0.0/fileutils.rb:243:in `mkdir'
        /usr/lib/ruby/3.0.0/fileutils.rb:243:in `fu_mkdir'
        /usr/lib/ruby/3.0.0/fileutils.rb:221:in `block (2 levels) in mkdir_p'
        /usr/lib/ruby/3.0.0/fileutils.rb:219:in `reverse_each'
        /usr/lib/ruby/3.0.0/fileutils.rb:219:in `block in mkdir_p'
        /usr/lib/ruby/3.0.0/fileutils.rb:211:in `each'
        /usr/lib/ruby/3.0.0/fileutils.rb:211:in `mkdir_p'
        /usr/lib/ruby/3.0.0/rubygems/source.rb:151:in `fetch_spec'
        /usr/lib/ruby/3.0.0/rubygems/resolver/api_specification.rb:92:in `spec'
        /usr/lib/ruby/3.0.0/rubygems/resolver/installer_set.rb:98:in `add_always_install'
        /usr/lib/ruby/3.0.0/rubygems/dependency_installer.rb:322:in `resolve_dependencies'
        /usr/lib/ruby/3.0.0/rubygems/commands/install_command.rb:201:in `install_gem'
        /usr/lib/ruby/3.0.0/rubygems/commands/install_command.rb:226:in `block in install_gems'
        /usr/lib/ruby/3.0.0/rubygems/commands/install_command.rb:219:in `each'
        /usr/lib/ruby/3.0.0/rubygems/commands/install_command.rb:219:in `install_gems'
        /usr/lib/ruby/3.0.0/rubygems/commands/install_command.rb:167:in `execute'
        /usr/lib/ruby/3.0.0/rubygems/command.rb:323:in `invoke_with_build_args'
        /usr/lib/ruby/3.0.0/rubygems/command_manager.rb:185:in `process_args'
        /usr/lib/ruby/3.0.0/rubygems/command_manager.rb:149:in `run'
        /usr/lib/ruby/3.0.0/rubygems/gem_runner.rb:51:in `run'
        /usr/bin/gem:13:in `<main>'
==> ERROR: A failure occurred in package().
Finished with result: exit-code
Main processes terminated with: code=exited/status=4

You should not do that.
It will ask for permissions when needed.
Try it :nerd_face:

1 Like

Many thanks, that worked - and I actually learned something important. :pray:

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.