The Chef Client always runs as root unless you specify otherwise. If you are running as root, you don't need sudo.
How can I use sudo for gem_package resource
-
11-10-2022 - |
Pergunta
I want to install the bluepill service, but when I try to do this without sudo I get the following error.
vagrant@leibniz-my-app:~$ gem install bluepill
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /opt/vagrant_ruby/lib/ruby/gems/1.8 directory.
Then if I want to reuse the bluepill cookbook for this, I have this problem, because this cookbook use gem_package and it hasn't an option sudo.
gem_package "bluepill" do
version node["bluepill"]["version"] if node["bluepill"]["version"]
action :install
end
Then my question is: It is possible to use sudo into a gem_package resource?
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow