moovweb / gvm

Go Version Manager
http://github.com/moovweb/gvm
MIT License
10.18k stars 533 forks source link

Installing on MacOS Big Sur #360

Open bullgare opened 3 years ago

bullgare commented 3 years ago

Installing go from scratch does not work for Big Sur as 1.4 does not have a binary for this OS (this command fails - gvm install go1.4 -B). To use gvm, you can do this:

  1. Install go from the official site
  2. gvm install go1.15.5
  3. gvm use go1.15.5 --default
  4. sudo rm -rvf /usr/local/go/ (which will uninstall non-gvm version).
teuber789 commented 3 years ago

Thanks @bullgare, this worked for me as well.

dkorunic commented 3 years ago

Not only that, upgrading Go on Big Sur is broken since version checking code in download_binary() doesn't handle 11.0.x properly, resulting in "Binary Go unavailable for this platform" error message and exit 1.

patrykkrawczyk commented 3 years ago

in my opinion it's simpler and safer with brew (no need for sudo rm -rf):

brew install go
gvm install go1.15.5
gvm use go1.15.5 --default
brew uninstall go
septs commented 3 years ago

without homebrew version

$ curl -sSL https://golang.org/dl/go1.16.2.darwin-amd64.tar.gz | tar zxv
$ export GOROOT_BOOTSTRAP="$(pwd)/go"
$ gvm install go1.16.2
Downloading Go source...
Installing go1.16.2...
 * Compiling...
go1.16.2 successfully installed!
$ rm -rf go
jeremy-ebler-vineti commented 3 years ago

I submitted a patch that should resolve this https://github.com/moovweb/gvm/pull/380

Go version 1.4.x, is ancient at this point and will not work on Big Sur (it's nearly 6 years old), but more recent binary versions work as expected.

curtismenmuir commented 2 years ago

Agree with @patrykkrawczyk re brew.

One thing to add, remember to export GOROOT_BOOTSTRAP. If not then future gym install commands will fail to compile

brew install go
gvm install go1.15.5
gvm use go1.15.5 --default
brew uninstall go
export GOROOT_BOOTSTRAP=$GOROOT
gvm install go1.18.3
gvm use go1.18.3 --default
dothanhlam commented 1 year ago

For Mac M1, I was only success with go1.18 or go1.19 brew install go gvm install go1.19 gvm use go1.19 --default brew uninstall go export GOROOT_BOOTSTRAP=$GOROOT