LoginSignup
27
26

More than 5 years have passed since last update.

herokuコマンドをgemでインストールしたものからheroku toolbeltのものに置き換える

Posted at

heroku gemをインストールしようとすると以下のようにdeprecatedだというメッセージがでます。

 !    The `heroku` gem has been deprecated and replaced with the Heroku Toolbelt.
 !    Download and install from: https://toolbelt.heroku.com
 !    For API access, see: https://github.com/heroku/heroku.rb

herokuの操作をコマンドラインからする際に使うheroku CLIは、以前はgemで提供されていましたが、最近はheroku toolbelt経由でインストールするのが公式には推奨されているようです。

というわけで、gemでインストールしたものをアンインストールしてtoolbeltをインストールする手順です。

まず、使っているheorkuコマンドがgem経由であるか確かめます。

$ heroku version
heroku-gem/2.39.2 (x86_64-darwin11.4.0) ruby/1.9.3

のようにheroku-gemと表示されたらgem経由であることがわかります。toolbelt経由の場合はheroku-toolbeltと表示されます。

heroku gemのアンインストール

基本的にはgem uninstallするだけです。

$ gem uninstall heroku
Remove executables:
    heroku

in addition to the gem? [Yn]
Removing heroku
Successfully uninstalled heroku-2.39.2

rbenvを使っていて、他のrubyのバージョンでもheroku gemを使っていた場合は以下の様なメッセージがでます。

$ heroku
rbenv: heroku: command not found

The `heroku' command exists in these Ruby versions:
  1.9.3-p194

この場合は表示されたそれぞれのrubyのバージョンでgem uninstallします。

$ rbenv shell 1.9.3-p194
$ gem uninstall heroku

heroku toolbeltのインストール

からダウンロードしていれるだけ。

今後は自動でアップデートされるようになります。

$ which heroku
/usr/bin/heroku
$ heroku version
heroku-toolbelt/2.39.2 (x86_64-darwin10.8.0) ruby/1.9.3

参考

Heroku公式ブログ https://blog.heroku.com/archives/2012/10/15/upgrading-to-the-heroku-toolbelt

27
26
1

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
27
26