<div dir="ltr">Hi,<div><br></div><div>As part of a Portfile I am writing, I need to install a Ruby gem, so I have added this build block:</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div><font face="monospace">build {</font></div></div><div><div><font face="monospace"><span class="" style="white-space:pre">        </span>   system &quot;${prefix}/bin/gem-1.8 install CFPropertyList&quot;</font></div></div><div><div><font face="monospace">}</font></div></div></blockquote><div><br></div><div>This fails, because without root privileges, the gem cannot be installed. However if I change the build block to use sudo:</div><div><br></div><div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><font face="monospace">build {</font></div><div><font face="monospace"><span class="" style="white-space:pre">        </span>   system &quot;sudo ${prefix}/bin/gem-1.8 install CFPropertyList&quot;</font></div><div><font face="monospace">}</font></div><div><font face="monospace"><br></font></div></blockquote><font face="arial, helvetica, sans-serif">It also fails, but this time with this error message:</font></div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace">:info:build sh: /usr/bin/sudo: Operation not permitted</font></div></blockquote><div><br></div><div>What&#39;s the proper way of invoking such commands that need root level permissions?</div><div><br></div><div><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br></div>Behrang<br><div><a href="http://www.behrang.org" target="_blank">http://www.behrang.org</a></div></div></div></div>
</div></div>