1

我对 Ruby、Git 和 Heroku 非常陌生,我正在尝试在我的 Window 7 机器上进行所有设置。第一个错误很容易通过编辑几个heroku文件以包含rest-client gem来修复,但现在我得到了这个错误,我无法使用“google it”方法解决它:

C:\rails\first_app>heroku login
DL is deprecated, please use Fiddle
Enter your Heroku credentials.
Email: foo
Password (typing will be hidden): C:/ruby/lib/ruby/2.0.0/Win32API.rb:14:in `init
ialize': No such file or directory (LoadError)
        from C:/ruby/lib/ruby/2.0.0/Win32API.rb:14:in `dlopen'
        from C:/ruby/lib/ruby/2.0.0/Win32API.rb:14:in `initialize'
        from C:/ruby/lib/ruby/gems/2.0.0/gems/heroku-3.0.1/lib/heroku/auth.rb:19
7:in `new'
        from C:/ruby/lib/ruby/gems/2.0.0/gems/heroku-3.0.1/lib/heroku/auth.rb:19
7:in `ask_for_password_on_windows'
        from C:/ruby/lib/ruby/gems/2.0.0/gems/heroku-3.0.1/lib/heroku/auth.rb:18
7:in `ask_for_credentials'
        from C:/ruby/lib/ruby/gems/2.0.0/gems/heroku-3.0.1/lib/heroku/auth.rb:22
1:in `ask_for_and_save_credentials'
        from C:/ruby/lib/ruby/gems/2.0.0/gems/heroku-3.0.1/lib/heroku/auth.rb:84
:in `get_credentials'
        from C:/ruby/lib/ruby/gems/2.0.0/gems/heroku-3.0.1/lib/heroku/auth.rb:41
:in `login'
        from C:/ruby/lib/ruby/gems/2.0.0/gems/heroku-3.0.1/lib/heroku/command/au
th.rb:31:in `login'
        from C:/ruby/lib/ruby/gems/2.0.0/gems/heroku-3.0.1/lib/heroku/command.rb
:213:in `run'
        from C:/ruby/lib/ruby/gems/2.0.0/gems/heroku-3.0.1/lib/heroku/cli.rb:28:
in `start'
        from C:/ruby/lib/ruby/gems/2.0.0/gems/heroku-3.0.1/bin/heroku:17:in `<to
p (required)>'
        from C:/ruby/bin/heroku:23:in `load'
        from C:/ruby/bin/heroku:23:in `<main>'

任何帮助将不胜感激。

编辑:

它是 ruby​​ 2.0.0 的 64 位版本。

嗯,我想我必须安装 32 位版本,直到这个问题得到解决。谢谢你的链接。

4

1 回答 1

1

可能是因为您正在运行 Ruby 2。我遇到了同样的问题。

我从这里复制粘贴我的答案:Heroku Login failed using Windows CLI

从安装目录外部使用“heroku login”命令时我遇到了同样的问题,因为它使用了我的 Ruby 2.1 安装,正如@kdmcclin 所解释的那样。

C:\>heroku login
DL is deprecated, please use Fiddle
Enter your Heroku credentials.
Email: xxxxx@xxxxxxx.net
Password (typing will be hidden): C:/Ruby21-x64/lib/ruby/2.1.0/Win32API.rb:14:in `initialize': No such file or directory (LoadError)
    from C:/Ruby21-x64/lib/ruby/2.1.0/Win32API.rb:14:in `dlopen'
    from C:/Ruby21-x64/lib/ruby/2.1.0/Win32API.rb:14:in `initialize'
    ...

但是,如果您先安装 dir,然后再安装“bin”,则该命令可以正常工作:

C:\Program Files (x86)\Heroku\bin>heroku login
Enter your Heroku credentials.
Email: xxxxx@xxxxxxx.net
Password (typing will be hidden):
Authentication successful.

但是,我们必须从我们的项目目录运行命令。所以我所做的是更改 PATH 系统变量,以便在 Ruby2.1 之前拥有 Heroku/bin 路径。

旧路径:

C:\Ruby21-x64\bin;C:\Program Files (x86)\Heroku\bin;[...Otherstuff...];C:\Program Files (x86)\Git\bin\;C:\Program Files (x86)\git\cmd

新路径:

C:\Program Files (x86)\Heroku\bin;C:\Ruby21-x64\bin;[...Otherstuff...];C:\Program Files (x86)\Git\bin\;C:\Program Files (x86)\git\cmd

现在它正在工作:

C:\ProjectDir>heroku login
Enter your Heroku credentials.
Email: xxxxx@xxxxxxx.net
Password (typing will be hidden):
Authentication successful.
于 2015-02-26T15:46:59.840 回答