LoginSignup
13
11

More than 3 years have passed since last update.

goenvでGo1.13.6をインストールメモ

Last updated at Posted at 2020-02-17

背景

homebrewでインストールしたgoenvをupgradeしたがインストールできるバージョンの最大が1.12だったので使いたかった1.13.6が使えなかった。

$ goenv install -l
Available versions:
  [省略]
  1.10.7
  1.11.0
  1.11beta2
  1.11beta3
  1.11rc1
  1.11rc2
  1.11.1
  1.11.2
  1.11.3
  1.11.4
  1.12beta1

作業メモ

goenvのディレクトリとbrewのgoenvを一旦削除

$ rm -rf `goenv root`
$ brew uninstall goenv

goenv/INSTALL.mdの手順通りにコマンド実行

$ git clone https://github.com/syndbg/goenv.git ~/.goenv
$ echo 'export GOENV_ROOT="$HOME/.goenv"' >> ~/.bash_profile
$ echo 'export PATH="$GOENV_ROOT/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(goenv init -)"' >> ~/.bash_profile
$ echo 'export PATH="$GOROOT/bin:$PATH"' >> ~/.bash_profile
$ echo 'export PATH="$PATH:$GOPATH/bin"' >> ~/.bash_profile
$ eval "$(goenv init -)"
$ brew install goenv

インストールされている事を確認

$ goenv install -l
Available versions:
  [省略]
  1.11.12
  1.11.13
  1.12.0
  1.12beta1
  1.12beta2
  1.12rc1
  1.12.1
  1.12.2
  1.12.3
  1.12.4
  1.12.5
  1.12.6
  1.12.7
  1.12.8
  1.12.9
  1.12.10
  1.12.11
  1.12.12
  1.12.13
  1.12.14
  1.12.15
  1.12.16
  1.12.17
  1.13.0
  1.13beta1
  1.13rc1
  1.13rc2
  1.13.1
  1.13.2
  1.13.3
  1.13.4
  1.13.5
  1.13.6
  1.13.7
  1.13.8
  1.14beta1
  1.14rc1

Go1.13.6をインストール

$ goenv install 1.13.6
Downloading go1.13.6.darwin-amd64.tar.gz...
-> https://dl.google.com/go/go1.13.6.darwin-amd64.tar.gz
Installing Go Darwin 64bit 1.13.6...
Installed Go Darwin 64bit 1.13.6 to /Users/xxxxxxxxx/.goenv/versions/1.13.6

1.13.6が使えるようにする

$ goenv global 1.13.6
$ goenv rehash
$ goenv versions
  system
* 1.13.6 

アップグレードする場合

$ cd ~/.goenv
$ git pull

参考

13
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
11