How to deploy a website on Heroku?

孤街醉人 提交于 2019-12-11 03:26:54

问题


I haven't got what to enter in fields Username for and Password for after the command git push heroku master:

C:\code2015>git push heroku master
Username for 'https://git.heroku.com': nemo
Password for 'https://nemo@git.heroku.com':
remote: !       WARNING:
remote: !       Do not authenticate with username and password using git.
remote: !       Run `heroku login` to update your credentials, then retry        
the git command.
remote: !       See documentation for details:       
https://devcenter.heroku.com/articles/http-git#authentication
fatal: Authentication failed for 'https://git.heroku.com/django-blog.git/'

I have read documents, but do not still understand.

C:\code2015>heroku login
Enter your Heroku credentials.
Email: nemo@yandex.ru
Password (typing will be hidden):
Authentication successful.

回答1:


For my situation, I have "identity crises", as I installed git through cygwin, while I used Heroku's toolbelt: heroku login successfully in DOS Command console (CMD).

For CMD, the %HOME% is c:\Users\my-id

for cygwin, $HOME is different

I found that _netrc was placed in both $HOME and %HOME%

I had to

copy $HOME/_netrc $HOME/.netrc then

git push heroku master

succeeded.




回答2:


Just to be more definite.

This works for me on Windows 8.
In cmd do:

set HOME=%USERPROFILE%



回答3:


this happens because the home folder isn't the same with the toolbelt and git when finding the _netrc. Can you show me the output of each of the following?

echo %HOME%
echo %HOMEDRIVE%%HOMEPATH%
echo %USERPROFILE%
echo %HOMESHARE%

then you'll need to find out where the _netrc file is, copy it into one of the paths above and find out which is the correct location. Let me know which is the correct one for you.




回答4:


I had similar problem,

heroku login

was saving _netrc file at my user directory ( %USERPROFILE%, the same as %HOMEDRIVE%%HOMEPATH% ) but GIT didn't use that (it looks like it reads only %HOME% variable). I set

%HOME% 

variable to the same value (so it is c:\user\<my account>\ now and there is also _netrc file) and GIT started to work




回答5:


To have ability to push to heroku git repository you have to login with heroku gem

heroku login

and then you can use regular git commands. Just try again

heroku login
git push heroku master


来源:https://stackoverflow.com/questions/29018498/how-to-deploy-a-website-on-heroku

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