LoginSignup
0
0

More than 1 year has passed since last update.

Heroku CLIをBeta版にアップグレードできなかった問題

Last updated at Posted at 2022-01-17

herokuにアプリ作成時にハマったので備忘録もかねてメモ

OS:Ubuntu20.04

Heroku CLI を ubuntuにインストール

$ wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh
$ heroku -v
heroku/7.59.2 linux-x64 node-v12.21.0

plugin-manifestインストール

$ heroku plugins:install @heroku-cli/plugin-manifest
$ heroku plugins
manifest 0.0.5

Heroku アプリ作成

heroku create <アプリ名> --manifest

アプリは作成されるが、heroku.ymlに記載されているaddonsとconfigで記載した[環境変数]が反映されない。。

調査したところ、HerokuがBeta版にアップグレードされていなければ、Plugin manifestも実行されない模様。

Heroku CLIをBeta版にアップグレード

$ heroku update beta
 ›   Warning: update with "sudo apt update && sudo apt install heroku"
Updating completions... ⣻ [4/4] Building fresh packages...
Updating completions... done
$ heroku -v
heroku/7.59.2 linux-x64 node-v12.21.0

アップグレードできない。。

色々調べた結果、一度削除して再インストールするのが良いらしいので削除

Heroku CLI削除

which heroku
sudo rm -v <which herokuで表示されたパス>
cd /usr/ && find -type d -name 'heroku'
sudo rm -rfv /usr/lib/heroku
cd (ホームディレクトリへ移動)
find  -type d -name 'heroku'
rm -rfv ~/.local/share/heroku ~/.cache/heroku

参考サイト

Heroku再インストール

$ curl https://cli-assets.heroku.com/install.sh | sh
$ sudo heroku -v
heroku/7.59.2 linux-x64 node-v12.21.0

Beta版にアップアップグレード

$ sudo heroku update beta
heroku: Updating CLI from 7.59.2 to 7.59.2-beta.67d33d6 (beta)... done
Updating completions... ⡿ [4/4] Building fresh packages...
Updating completions... ⣻ [4/4] Building fresh packages...
$ sudo heroku -v
heroku/7.59.2-beta.67d33d6 linux-x64 node-v12.21.0

ようやくアップグレードできた。
原因はよくわからないが、Heroku CLIのインストールは

https://cli-assets.heroku.com/install-ubuntu.sh

ではなく

https://cli-assets.heroku.com/install.sh 

でやらないとBeta版にアップグレードできないのかもしれない。

0
0
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
0
0