moovweb / gvm

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

MacOS zsh (at least) install fail related to missing default #449

Closed bentito closed 1 month ago

bentito commented 1 year ago

MacOS: 14.0 GVM Verson: 1.0.22 shell: zsh

I may need some help figuring out what went wrong, because although I think I fixed my install with a workaround, I'm not sure what broke or why doing what I did fixed it:

After running the install script, the inserted command in my .zshrc' was causing this error all the time: ERROR: Invalid or corrupt Go version`

And I think I correctly traced the root cause to this being missing:

$ . "$GVM_ROOT/environments/default"
.: no such file or directory: /Users/bentito/.gvm/environments/default

So I did this from .gvm/environments:

$ ln -s go1.21.2 default

and that seems to have fixed the erroring. Though I had to remove that symlink and run through a few iterations of gvm use goX.Y --default to properly create $GVM_ROOT/environments/default in order to have the default functionality work.

probably unrelated: I installed GVM by installing binary version of go1.18, then normal install of go1.21.2 and I rm'ed and reinstalled via the installer script a few times.

If someone can explain this better such that a fix to the installer can be proposed I'd be happy to make a PR

dannywillems commented 1 year ago

Having the same error: "ERROR: Invalid or corrupt Go version", with the latest master.

dannywillems commented 1 year ago

Using gvm use [VERSION] --default fixes the issue.

ankitcharolia commented 1 year ago

@bentito @dannywillems kindly try this out. I am using this goenv: https://github.com/ankitcharolia/goenv.

ibnumardini commented 1 year ago

Using gvm use [VERSION] --default fixes the issue.

That works for me, thanks, dude!

yinyu985 commented 1 month ago

So we can close this issue, right?

bentito commented 1 month ago

I think can close, yep