heroku / legacy-cli

Heroku CLI
https://cli.heroku.com
MIT License
1.37k stars 380 forks source link

undefined method `[]' for nil:NilClass (NoMethodError) #1961

Closed BrunoQuaresma closed 7 years ago

BrunoQuaresma commented 8 years ago

heroku create ! Heroku client internal error. ! Search for help at: https://help.heroku.com ! Or report a bug at: https://github.com/heroku/heroku/issues/new

Error:       undefined method `[]' for nil:NilClass (NoMethodError)
Command:     heroku create
Version:     heroku-toolbelt/3.43.3 (x86_64-linux) ruby/2.2.2
Error ID:    87dc922cc4a84b96ab17b7a996ae1490

! Heroku client internal error. ! Search for help at: https://help.heroku.com ! Or report a bug at: https://github.com/heroku/heroku/issues/new

Error:       undefined method `[]' for nil:NilClass (NoMethodError)
Command:     heroku login
Version:     heroku-toolbelt/3.43.3 (x86_64-linux) ruby/2.2.2
Error ID:    32f3c0e701054954b994fbb020189338
vijayvaradan commented 8 years ago

I get the same error on Ubuntu 16.04 LTS and ruby 2.3.0:

 !    Heroku client internal error.
 !    Search for help at: https://help.heroku.com
 !    Or report a bug at: https://github.com/heroku/heroku/issues/new

    Error:       undefined method `[]' for nil:NilClass (NoMethodError)
    Command:     heroku login
    Version:     heroku-toolbelt/3.43.3 (x86_64-linux-gnu) ruby/2.3.0
    Error ID:    dd5e9c2dae2f4c97b7c5a5c71aa42b52

I've tried uninstalling and re-installing heroku and heroku-toolbelt to no avail. The following solution worked:

rm -rf ~/.local/share/heroku
rm -rf ~/.config/heroku
rm -rf ~/.cache/heroku
rm -rf ~/.heroku

Running heroku login and other commands worked fine after that.

ransombriggs commented 8 years ago

@BrunoQuaresma sorry for the delayed response, but @vijayvaradan suggestion will clean out all the heroku update and configuration files, which would give you a fresh installation and may fix your problem. I should note however, that you would have to re-install any custom plugins that you have installed by hand.

BrunoQuaresma commented 7 years ago

@vijayvaradan it works! Thanks!

@ransombriggs maybe, this script can be add in the Ubuntu install doc.