我有一个需要 gem 的 Rails 应用程序。我将这个 gem 托管在私有存储库的 bitbucket 上。
在我的 Gemfile 中,我添加了 gem,如下所示:
gem "my-gem", :git => "gi[email protected] /cdn-cgi/l/email-protection:my-username/my-gem.git", :branch => 'master'
我想在 heroku 上部署我的 Rails 应用程序
git push heroku master
现在我总是收到以下错误
Fetching [email protected] /cdn-cgi/l/email-protection:my-username/my-git-repo.git
Host key verification failed.
fatal: The remote end hung up unexpectedly
我理解这个错误,因为存储库设置为私有。但我该如何解决这个问题呢?
我已经读过这个问题:在 bitbucket 上使用 git 部署到 Heroku https://stackoverflow.com/questions/13240227/deploying-to-heroku-using-git-on-bitbucket,但我真的没有得到答案:)..
Bitbucket 允许在类似于 github 的存储库 URL 上进行 HTTP 基本身份验证。将 gem 的 URL 指定为https://username:[email protected] /cdn-cgi/l/email-protection/username/gemrepo.git
.
It does意味着在 Gemfile 中包含您的用户名和密码,它本身是版本控制的,这不是一个好的做法,但另一方面这是 Heroku 推荐的,所以......
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)