我有一个私有(private) gitlab 主机,它托管私有(private)代码和项目,我在 heroku 中托管我的应用程序,在那个 heroku 应用程序中,我们使用 Gemfile 来管理那个 heroku 应用程序的依赖性,其中一个依赖性来自私有(private) gitlab 主机.所以我的 Gemfile 是这样的:
gem 'my_greate_gem', '0.0.1', :git => "http://myprivate_gitlab_host/private_gems/my_great_gem.git"
似乎没有任何教程提到使用私有(private) gitlab 主机在 Heroku 中托管 gem,但我真的不想使用 gemfury。有什么可能的解决方案吗?
最佳答案
如果不使用 Gemfury,您必须在 gem 依赖项的 URL 中传递用户名和密码
gem 'my_greate_gem', '0.0.1', :git => "http://<username>:<password>@myprivate_gitlab_host/private_gems/my_great_gem.git"
关于ruby - 是否可以从 Heroku 的私有(private) gitlab 主机安装 gem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22601829/