cirruslabs / macos-image-templates

MIT License
207 stars 56 forks source link

xcode template's rbenv environment is broken #134

Closed anders-nylander closed 6 months ago

anders-nylander commented 6 months ago

https://github.com/cirruslabs/macos-image-templates/blob/bf9f6a614634e37eac058953802a6a5d2fac4c76/templates/xcode.pkr.hcl#L105

At this point in the script, the gem command executes in the user folder, e.g. /Users/admin/.rbenv/shims/gem. But when these commands are run at this point in the script with the "sudo" prefix, we end up with a bunch of gems with mixed ownership inside the ~/.rbenv folder, which causes issues later down the line.

However, the sudo prefix isn't necessary when changing stuff in ~/.rbenv.