Heroku Login failed using Windows CLI

▼魔方 西西 提交于 2020-01-02 22:04:32

问题


I had downloaded and installed heroku-toolbelt for my Window PC.
I wanted an application to be deployed to heroku , but My login fails
Please help me to solve this problem

The error messages are written below.

C:\Users\shree1>heroku login
DL is deprecated, please use Fiddle
Enter your Heroku credentials.
Email: xxxx@xxx.com
Password (typing will be hidden): C:/Ruby200-x64/lib/ruby/2.0.0/Win32API.rb
n `initialize': No such file or directory (LoadError)
    from C:/Ruby200-x64/lib/ruby/2.0.0/Win32API.rb:14:in `dlopen'
    from C:/Ruby200-x64/lib/ruby/2.0.0/Win32API.rb:14:in `initialize'
    from C:/Users/shree1/.heroku/client/lib/heroku/auth.rb:236:in `new'
    from C:/Users/shree1/.heroku/client/lib/heroku/auth.rb:236:in `ask_
    assword_on_windows'
    from C:/Users/shree1/.heroku/client/lib/heroku/auth.rb:211:in `ask_
    redentials'
    from C:/Users/shree1/.heroku/client/lib/heroku/auth.rb:262:in `ask_
    nd_save_credentials'
    from C:/Users/shree1/.heroku/client/lib/heroku/auth.rb:106:in `get_
    ntials'
    from C:/Users/shree1/.heroku/client/lib/heroku/auth.rb:41:in `login
    from C:/Users/shree1/.heroku/client/lib/heroku/command/auth.rb:31:i
    gin'
    from C:/Users/shree1/.heroku/client/lib/heroku/command.rb:221:in `r
    from C:/Users/shree1/.heroku/client/lib/heroku/cli.rb:39:in `start'
    from C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'

This is the error messege which is being displayed.


回答1:


I was having the same problem when using "heroku login" command from outside the install dir, because it used my Ruby 2.1 installation as explained by @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'
    ...

But if you go first to install dir and then "bin", the command works fine :

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

But, we have to run the command from our project dir. So what I did is changing the PATH system variable in order to have Heroku/bin path before Ruby2.1.

Old PATH :

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

New PATH :

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

And now it's working :

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



回答2:


I'm muddling my way through sorting out the problem myself, but it seems to be a conflict between the ruby version included in the toolbelt (1.9.3) and the ruby version you're using. In my case I switched ruby versions to 1.9.3 and the toolbelt worked. It didn't matter that my app was running a more recent version of ruby.



来源:https://stackoverflow.com/questions/27740168/heroku-login-failed-using-windows-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!