2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Heroku CLI ] install時に「rm /usr/local/bin/heroku」が失敗する場合の対処法

Posted at

実施事項

heroku公式サイトの記載通り、以下コマンドにてheroku CLIをインストールしようとしたら、エラーでインストール出来ませんでした。

curl https://cli-assets.heroku.com/install-standalone.sh | sh

error内容

/usr/local/bin/herokuのrmに失敗している模様

+ rm /usr/local/bin/heroku
rm: cannot remove `/usr/local/bin/heroku': No such file or directory

対処法

/usr/local/bin/herokuを作成し、再実行したらインストール出来ました。

[root@myServer lib]# cd /usr/local/bin/
[root@myServer bin]# ls
ajaxterm
[root@myServer bin]# touch heroku
[root@myServer bin]# curl https://cli-assets.heroku.com/install-standalone.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
103  1349  103  1349    0     0   6763      0 --:--:-- --:--:-- --:--:--  439k
+ [[ ! :/usr/local/rbenv/shims:/usr/local/rbenv/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin: == *\:\/\u\s\r\/\l\o\c\a\l\/\b\i\n\:* ]]
++ uname
+ '[' Linux == Darwin ']'
+++ uname -s
++ expr substr Linux 1 5
+ '[' Linux == Linux ']'
+ OS=linux
++ uname -m
+ ARCH=x86_64
+ '[' x86_64 == x86_64 ']'
+ ARCH=x64
+ mkdir -p /usr/local/lib
+ cd /usr/local/lib
+ rm -rf heroku
+ rm -rf /root/.local/share/heroku/client
+ tar xz
+ curl https://cli-assets.heroku.com/heroku-linux-x64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 20.6M  100 20.6M    0     0  3419k      0  0:00:06  0:00:06 --:--:-- 3071k
+ rm /usr/local/bin/heroku
+ ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku
heroku installed to /usr/local/bin/heroku
heroku/7.0.26 linux-x64 node-v10.0.0
[root@myServer bin]# which heroku
/usr/local/bin/heroku
[root@myServer bin]#
2
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?