LoginSignup
1
1

More than 5 years have passed since last update.

heroku のCLIをOracleLinuxにインストールする

Last updated at Posted at 2017-08-20

公式サイトを見てみる

https://devcenter.heroku.com/articles/heroku-cli
それらしきスクリプトを実行するもエラー。。

ググる

http://blog.tokoyax.com/entry/heroku/command-install
これに沿ってやってみる。
-1.wgetで取得

$ sudo wget -qO- https://toolbelt.heroku.com/install.sh --no-check-certificate | sh
This script requires superuser access to install software.
You will be prompted for your password by sudo.
Add the Heroku CLI to your PATH using:
$ echo 'PATH="/usr/local/heroku/bin:$PATH"' >> ~/.profile

-2.コマンドへパスを通す

$ vi ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin

heroku のパスを追加

PATH=/usr/local/heroku/bin:$PATH
export PATH

-3.profileをリロード

$ source ~/.bash_profile

-4.バージョンの確認

$ heroku -version

最新じゃないのでとってきてくれるっぽい。

$ heroku --version
WARNING: This is the legacy Heroku CLI with limited functionality. Please install the latest CLI.
WARNING: Installation instructions are at https://cli.heroku.com
heroku-cli: Installing CLI... 25.58MB/25.58MB
heroku-cli/5.12.0-0ab8352 (linux-amd64) go1.7.5

それでもやっぱり最新じゃないっていうエラーなので初心に戻って以下を実行

$ wget https://cli-assets.heroku.com/heroku-cli/channels/stable/heroku-cli-linux-x64.tar.gz -O 
heroku.tar.gz
$ tar -xvzf heroku.tar.gz
$ mkdir -p /usr/local/lib /usr/local/bin
$ mv heroku-cli-v6.13.18-a444c52-linux-x64 /usr/local/lib/heroku
$ ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku

heokuはどこにあるか確認。

$ which heroku
/usr/local/bin/heroku

heroku バージョン確認

$ heroku --version
heroku-cli/6.13.18-a444c52 (linux-x64) node-v8.3.0
1
1
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
1
1