英文:
Golang 1.6.2 Won't Upgrade on OSX Sierra
问题
我刚刚从El Capitan升级到了OSX Sierra。因此,我还需要升级我的Golang编译器,因为1.6.2版本不支持Sierra。
我下载了最新的1.7.5 pkg安装程序并运行它,得到了一个提示,说它会删除之前的Go版本,并且显示安装成功。但是当我运行go version
时,它仍然显示go1.6.2 darwin/amd6
。
我已经手动删除了/usr/local/bin/go
目录,并再次运行了1.7.5安装程序,但是go version
仍然显示go1.6.2 darwin/amd6
。我还尝试过在尝试之间重新启动终端窗口甚至整个计算机。
出了什么问题?我该如何更新我的Go编译器?
英文:
I just upgraded to OSX Sierra from El Capitan. As such, I also need to upgrade my Golang compiler from 1.6.2 since it does not support Sierra.
I downloaded the latest 1.7.5 pkg installer and ran it, getting the prompt that it would remove previous versions of Go, and it said it was successful. But when I run go version
it still says go1.6.2 darwin/amd6
.
I have gone so far as to manually delete my /usr/local/bin/go
directory and run the 1.7.5 installer again, but go version
still says go1.6.2 darwin/amd6
. I have also restarted my terminal window and even the full computer between attempts.
What is going wrong? How can I get my Go compiler to update?
答案1
得分: 1
我在我的问题中有错误。实际上我删除的是 usr/local/go
而不是 usr/local/bin/go
。我回去手动删除了这两个目录,然后再次运行了1.7.5版本的安装程序。重新启动终端窗口后,go version
现在显示我正在使用1.7.5版本,并且当我编译代码时它似乎正常运行。
仍然有趣的是,安装程序没有像它说的那样自动执行这个操作。如果其他人遇到同样的问题,这可能作为一个解决方案。
英文:
I was incorrect in my question. I actually deleted usr/local/go
, not usr/local/bin/go
. I went back and deleted both directories manually, then ran the 1.7.5 package installer again. After restarting my terminal window, go version
now shows me I am on 1.7.5 and it appears to be running correctly when I compile my code.
Still interesting that the package installer did not do this automatically like it said it would. This could work as a solution if someone else is having the same problem.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论