创建一个 gem 服务器,我可以将 gem 发布到其中
我已经使用 Gemcutter 编写了一些 gem,并将其发布到 rubygems,源代码存储在 github 上。
我有一个问题,我需要创建一个不能开源的 gem,也不能向社区提供,而只能向我的团队成员提供。
我知道我可以在本地存储宝石并将它们定位在我的 Gemfile 中,但是我希望能够执行
rake version:bump
rake release
或类似的操作。这会改变版本并将其推送到我的 gem 服务器,并且仍然保留旧的 gem,以便人们可以安装它的旧版本。
看起来做起来应该相当简单。我只是想念如何去做
I've written a few gems that I've released to rubygems using Gemcutter and the source stored on github.
I have issue that I need to create a gem that can't be open source and also not available to the community, but only to members of my team.
I am aware that I can store gems locally and target them in my Gemfile, however I'd like to be able to do
rake version:bump
rake release
or similar. That would bump the version and push it to my gem server and still keep older gems so that people can install older versions of it.
Seems like it should be fairly simple to do. I'm just missing how to do it
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您有一台可以托管您的私人宝石的服务器,那么这相当简单。设置一个子域,例如
gems.companyname.com
并设置一个虚拟主机来托管您的域。您可以将该虚拟主机指向一个文件夹,就像您指向任何网站一样,然后从那里设置 gem 服务器。示例:
/var/www/gemserver
将是根目录。最后,您需要做的就是向您的Gemfile
添加新的源,以便任何了解您的自定义域的人都可以访问 gem。唯一的痛苦是每次重建 gem 时,在将 gem 上传到 gems 文件夹后,都需要再次运行
generate_index
命令。This is fairly simple if you have a server you can host your private gems on. Setup a subdomain, something like
gems.companyname.com
and setup a virtual host to host your domain. You'd point that virtual host to a folder like you would any website and setup the gem server from there.Example:
/var/www/gemserver
would be the root directory. Lastly all you'd need to do is add a new source to yourGemfile
So anyone that knows about your custom domain can get access to the gems. The only pain is every time you rebuild your gem you need to run the
generate_index
command again after you upload your gem to the gems folder.