heroku上的bitbucket私有存储库 [英] bitbucket private repository on heroku

查看:138
本文介绍了heroku上的bitbucket私有存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要宝石的导轨应用程序。



<$>在我的Gemfile中,我添加了如下所示的gem:

  gemmy-gem,::git => git@bitbucket.org:my-username / my-gem.git,:branch => 'master'

我想在heroku上部署我的rails应用程序,并带有

  git push heroku master 

现在我总是得到以下错误:

 获取git@bitbucket.org:my-username / my-git-repo.git 
主机密钥验证失败。
fatal:远端意外挂了

我明白这个错误,因为存储库是设置为私人。但我该如何解决这个问题?



我已经阅读过这个问题:,但我没有真正得到答案:)..

Bitbucket允许在类似于github的存储库URL上进行HTTP基本认证。指定gem的网址为 https:// username:password@bitbucket.org/username/gemrepo.git



是指在你的Gemfile中拥有你的用户名和密码,它本身是受版本控制的,这不是一个好习惯,但另一方面,这是Heroku推荐的,所以...


I have a rails app which requires a gem. I host this gem on bitbucket in a private repository.

In my Gemfile I added the gem like following:

gem "my-gem", :git => "git@bitbucket.org:my-username/my-gem.git", :branch => 'master'

I want to deploy my rails app on heroku with

git push heroku master

Now I always get following error

Fetching git@bitbucket.org:my-username/my-git-repo.git
Host key verification failed.
fatal: The remote end hung up unexpectedly

I understand the error, because the repository is set to private. But how can I solve this problem?

I already read this question: Deploying to Heroku using git on bitbucket, but I don´t really get the answer :)..

解决方案

Bitbucket allows for HTTP basic auth on repository URLs similar to github. Specify the URL for the gem as https://username:password@bitbucket.org/username/gemrepo.git.

It does mean having your username and password in your Gemfile, which itself is version controlled, and that's not a good practice, but on the other hand that's what Heroku recommends, so...

这篇关于heroku上的bitbucket私有存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆