-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windows: fix gem: --no-document in gemrc #398
Conversation
TIPS: c:\ProgramData\gemrc was generated by ridk install 3. |
Before: ri documentation was installed unexpectedly https://github.com/fluent/fluentd-docker-image/actions/runs/10843478819/job/30090722070 |
install: --no-document might be better. |
Hmm, update: --no-document too. |
https://github.com/fluent/fluentd-docker-image/actions/runs/10844861419/job/30094542725?pr=398 gemrcの修正で期待通りri installされなくなった
|
ridk install 3が生成するgemrcの既定値が今後変わって問題になるようならそのときまた考えればいいだろう。 |
I see. I asked rubyinstaller2 about this point. |
I'll fix it a bit. |
In the previous versions, append gem: --no-document for c:\ProgramData\gemrc, but it does not work as expected because the default gemrc content is different as we thought. So, we should override explicitly by gem: --no-document here. C:\>type c:\ProgramData\gemrc # This is the system wide config file for Rubygems. # It is generated by RubyInstaller as a security measure. # Feel free to add any rubygems config options as described on: # https://docs.ruby-lang.org/en/3.1/Gem/ConfigFile.html # But do not delete this file as otherwise it could be hijacked by # another user in a multi-user environment. --- {} gem: --no-document C:\>echo gem: --no-document > c:\ProgramData\gemrc C:\>type c:\ProgramData\gemrc gem: --no-document C:\>gem install json Fetching json-2.7.2.gem Temporarily enhancing PATH for MSYS/MINGW... Building native extensions. This could take a while... Successfully installed json-2.7.2 1 gem installed Signed-off-by: Kentaro Hayashi <[email protected]>
changed to use ruby's one-liner script to replace it. It will be safe even though the default gemrc was changed by ridk. |
Just to be sure, I have confirmed that overwriting the file doesn't change the ACL. Powershell with administrative privilege > cp C:\ProgramData\gemrc C:\ProgramData\gemrc.cp
> Set-Acl C:\ProgramData\gemrc.cp -AclObject (Get-Acl C:\ProgramData\gemrc)
> Get-Acl .\gemrc.cp | Format-List Owner,Group,AccessToString
Owner : NT AUTHORITY\SYSTEM
Group : NT AUTHORITY\SYSTEM
AccessToString : NT AUTHORITY\SYSTEM Allow FullControl
BUILTIN\Administrators Allow FullControl
BUILTIN\Users Allow ReadAndExecute, Synchronize Command Prompt with administrative privilege echo gem: --no-document > \ProgramData\gemrc.cp Powershell with administrative privilege > Get-Acl .\gemrc.cp | Format-List Owner,Group,AccessToString
Owner : NT AUTHORITY\SYSTEM
Group : NT AUTHORITY\SYSTEM
AccessToString : NT AUTHORITY\SYSTEM Allow FullControl
BUILTIN\Administrators Allow FullControl
BUILTIN\Users Allow ReadAndExecute, Synchronize |
I have confirmed it is the same when using Ruby. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for this!
Please regenerate Dockerfiles.
Co-authored-by: Daijiro Fukuda <[email protected]> Signed-off-by: Kentaro Hayashi <[email protected]>
Signed-off-by: Kentaro Hayashi <[email protected]>
I've forgot it to do so.... |
In the previous versions, append gem: --no-document for c:\ProgramData\gemrc, but it does not work as expected because the default gemrc content is different as we thought.
So, we should override explicitly by gem: --no-document here.
Checked with installing json gem about this behavior.