`buildpacks`不是heroku命令

时间:2016-08-21 18:14:32

标签: ruby-on-rails heroku buildpack

我正在尝试将buildpack添加到我的heroku应用程序中,但正在运行

heroku buildpacks:set third_party_buildpack

返回

!    `buildpacks:set` is not a heroku command.
!    See `heroku help` for a list of available commands.

当我跑

heroku buildpacks

我得到了

!    `buildpacks` is not a heroku command.
!    See `heroku help` for a list of available commands.

即使

heroku help buildpacks

返回相同的内容,

heroku help

返回

Usage: heroku COMMAND [--app APP] [command-specific-options]

Primary help topics, type "heroku help TOPIC" for more details:

  addons    #  manage addon resources
  apps      #  manage apps (create, destroy)
  auth      #  authentication (login, logout)
  config    #  manage app config vars
  domains   #  manage custom domains
  logs      #  display logs for an app
  ps        #  manage dynos (dynos, workers)
  releases  #  manage app releases
  run       #  run one-off commands (console, rake)
  sharing   #  manage collaborators on an app

Additional topics:

  certs        #  manage ssl endpoints for an app
  drains       #  display drains for an app
  features     #  manage optional features
  fork         #  clone an existing app
  git          #  manage git for apps
  help         #  list commands and display help
  keys         #  manage authentication keys
  labs         #  manage optional features
  maintenance  #  manage maintenance mode for an app
  members      #  manage membership in organization accounts
  orgs         #  manage organization accounts
  pg           # 
  pgbackups    #  manage backups of heroku postgresql databases
  plugins      #  manage plugins to the heroku gem
  regions      #  list available regions
  stack        #  manage the stack for an app
  status       #  check status of heroku platform
  twofactor    # 
  update       #  update the heroku client
  version      #  display version

请注意帮助主题中缺少buildpack。我的heroku版本显示

heroku-toolbelt/3.25.0 (x86_64-linux) ruby/2.2.4

Heroku的buildpacks页面使它听起来像heroku buildpacks:set命令应该开箱即用。有谁知道为什么我的机器上似乎没有这个功能?我的应用程序是ruby(2.2.4)on rails(4.0.3),我运行的是Ubuntu 14.04。提前谢谢。

1 个答案:

答案 0 :(得分:1)

昨天我遇到了这个问题。事实证明我安装了一个相当旧版本的Heroku CLI或heroku gem。

当您在终端中输入heroku --version时,您会看到什么?

请参阅下面的内容:https://devcenter.heroku.com/articles/heroku-cli

 $ heroku --version
 heroku-toolbelt/3.43.9 (x86_64-darwin10.8.0) ruby/1.9.3
 heroku-cli/5.2.39-010a227 (darwin-amd64) go1.6.2
  

您应该在输出中看到heroku-toolbelt / x.y.z.如果你没有,但已经安装了Heroku CLI,你的系统上可能有一个旧的heroku gem - 卸载gem。

我运行gem uninstall 'heroku'并从此处运行安装程序:https://devcenter.heroku.com/articles/heroku-cli 然后gem install 'heroku'然后buildpack heroku命令开始为我工作。