I've been trying to install and use rbenv on an ubuntu 22.04 image installed on an M2 ARM mac deployed with Multipass.
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
appears to initially work like other approaches but with the same failure.
$ rbenv install 3.2.1
To follow progress, use 'tail -f /tmp/ruby-build.20230313130513.3853.log' or pass --verbose
Downloading ruby-3.2.1.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.1.tar.gz
Installing ruby-3.2.1...
mkdir: cannot create directory ‘/opt/homebrew’: Permission denied
BUILD FAILED (Ubuntu 22.04 using ruby-build 20230309-1-gf3c1ccc)
Inspect or clean up the working tree at /tmp/ruby-build.20230313130513.3853.nqCpQQ
I've seen a bunch of homebrew-related links in the ruby-build tree, but I'm in an ubuntu VM precisely to get away from macOS.
How can I fix this?