在 Windows 上使用 gem 安装 heroku 时出错

Error while installing heroku using gem on Windows

在安装 heroku 时,我会收到下面提到的错误:

$ gem install heroku

Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing heroku:
        ERROR: Failed to build gem native extension.

current directory: c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/heroku-3.99.4
c:/RailsInstaller/Ruby2.3.3/bin/ruby.exe -r ./siteconf20181030-11376-16mqlg7.rb extconf.rb
extconf.rb:1:in `<main>':  heroku must be installed from cli.heroku.com. This gem is no longer available. (RuntimeError)

extconf failed, exit code 1

Gem files will remain installed in c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/heroku-3.99.4 for inspection.
Results logged to c:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/extensions/x86-mingw32/2.3.0/heroku-3.99.4/gem_make.out

有什么问题,我该如何解决?

与其尝试 gem 安装,不如检查 , like downloading heroku-win32-x64.tar.gz 并将其解压缩到您选择的文件夹中。

然后确保将其添加到您的 %PATH%
或者 $PATH 如果您在 git bash 会话中:

export PATH=$PATH:/c/path/to/heroku

Heroku 的 Ruby CLI 不再维护,不应使用:

heroku must be installed from cli.heroku.com. This gem is no longer available.

任何告诉您安装 Ruby CLI 的资源都已过时。

new CLI is built in JavaScript. Heroku provides installers for macOS and Windows, and a snap for Ubuntu. It is also possible to install the CLI via npm,但在大多数情况下不推荐这样做。