I am trying to install fluentd and having configuration below:-
- Docker Version=20.10.12
- Alpine Linux Version=3.17.3
- Ruby Version= 3.1.4p223
I am installing the fluentd with the script details below:-
apk add sudo
sudo apk update
sudo apk add ruby
ruby -v
sudo gem install fluentd
This is failing at "sudo gem install fluentd" step with the error below:-
While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/lib/ruby/gems/3.1.0 directory.
/usr/lib/ruby/3.1.0/rubygems/installer.rb:712:in `verify_gem_home'
/usr/lib/ruby/3.1.0/rubygems/installer.rb:902:in `pre_install_checks'
/usr/lib/ruby/3.1.0/rubygems/installer.rb:302:in `install'
/usr/lib/ruby/3.1.0/rubygems/resolver/specification.rb:104:in `install'
/usr/lib/ruby/3.1.0/rubygems/request_set.rb:194:in `block in install'
/usr/lib/ruby/3.1.0/rubygems/request_set.rb:182:in `each'
/usr/lib/ruby/3.1.0/rubygems/request_set.rb:182:in `install'
/usr/lib/ruby/3.1.0/rubygems/commands/install_command.rb:210:in `install_gem'
/usr/lib/ruby/3.1.0/rubygems/commands/install_command.rb:226:in `block in install_gems'
/usr/lib/ruby/3.1.0/rubygems/commands/install_command.rb:219:in `each'
/usr/lib/ruby/3.1.0/rubygems/commands/install_command.rb:219:in `install_gems'
/usr/lib/ruby/3.1.0/rubygems/commands/install_command.rb:167:in `execute'
/usr/lib/ruby/3.1.0/rubygems/command.rb:323:in `invoke_with_build_args'
/usr/lib/ruby/3.1.0/rubygems/command_manager.rb:185:in `process_args'
/usr/lib/ruby/3.1.0/rubygems/command_manager.rb:149:in `run'
/usr/lib/ruby/3.1.0/rubygems/gem_runner.rb:51:in `run'
/usr/bin/gem:21:in `<main>'
[0mThe command '/bin/sh -c /installFluent.sh' returned a non-zero code: 1
I dont have privilages to update the docker version or alpine version. Ruby version i can update if required. can someone please suggest any work around for this issue? PS:- I followed below link as well but didn't worked for me. You don't have write permissions for the /usr/lib/ruby/gems/2.7.0 directory (Alpine linux docker image)