Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/55.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 在本地计算机上创建回购之前,忘记在Bitbucket上创建新回购_Ruby On Rails_Git_Heroku - Fatal编程技术网

Ruby on rails 在本地计算机上创建回购之前,忘记在Bitbucket上创建新回购

Ruby on rails 在本地计算机上创建回购之前,忘记在Bitbucket上创建新回购,ruby-on-rails,git,heroku,Ruby On Rails,Git,Heroku,我正在从迈克尔·哈特尔的教程中学习RoR。我使用git init创建了一个新的存储库,并继续: $ git remote add origin git@bitbucket.org:ashsean46/sampleapp.git 在运行此命令之前,我忘记在Bitbucket上初始化repo。 我在heroku上部署了该应用程序,并继续学习教程,直到这个命令难住了我: $ git push -u origin statpage ssh: Could not resolve hostname bit

我正在从迈克尔·哈特尔的教程中学习RoR。我使用git init创建了一个新的存储库,并继续:

$ git remote add origin git@bitbucket.org:ashsean46/sampleapp.git
在运行此命令之前,我忘记在Bitbucket上初始化repo。 我在heroku上部署了该应用程序,并继续学习教程,直到这个命令难住了我:

$ git push -u origin statpage
ssh: Could not resolve hostname bitbucket.org: no address associated with name
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
(这里statpage是我的分支)我以前犯过这个错误,但回购协议在一天后自动出现在Bitbucket上。我还尝试在heroku上运行主分支代码,一切正常

为什么会发生这种情况?
有没有办法在Bitbucket上显示创建的repo?

首先,运行
git remote-v
,检查它是否包含与Bitbucket repo相同的url。你会发现origin和heroku有两个不同的url。所以,它对您的heroku很好,但如果它没有包含正确的源url,那么您将面临这个问题。尝试运行
git远程设置url源https://github.com/USERNAME/OTHERREPOSITORY.git 
使用您的bitbucket回购的新url。请参阅
ssh:无法解析主机名bitbucket.org:没有与名称关联的地址
-我认为这是连接问题。你能通过浏览器访问Bitbucket吗?谢谢大家的回答。我完全删除了应用程序(删除了文件夹和rm-rf命令)。如果我再次犯错,我会尝试这种方法。是的,我可以在浏览器中打开bitbucket和heroku,@ShefaleeChaudhary-我再次犯错并尝试了你的方法。成功了!谢谢但现在每次我使用远程连接到我的git repo eg->git push的命令时,它都会询问我的电子邮件和bitbucket的密码。我该如何解决这个问题??