【问题标题】:Error while installing heroku using gem on Windows在 Windows 上使用 gem 安装 heroku 时出错
【发布时间】:2019-04-03 02:41:25
【问题描述】:

在安装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

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

【问题讨论】:

    标签: heroku rubygems git-bash


    【解决方案1】:

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

    heroku 必须从 cli.heroku.com 安装。此宝石不再可用。

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

    new CLI 是用 JavaScript 构建的。 Herokuprovides installers for macOS and Windows, and a snap for Ubuntu。也可以安装 CLI via npm,但在大多数情况下不建议这样做。

    【讨论】:

    • 这似乎比我的回答更准确。 +1
    【解决方案2】:

    不要尝试 gem 安装,而是查看 alternative installation method for heroku,例如下载 heroku-win32-x64.tar.gz 并将其解压缩到您选择的文件夹中。

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

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

    【讨论】:

      猜你喜欢
      • 2018-05-29
      • 2014-08-20
      • 2012-06-09
      • 2019-03-26
      • 2014-04-16
      • 1970-01-01
      • 2017-12-17
      • 1970-01-01
      • 2015-01-03
      相关资源
      最近更新 更多