创建一个 gem 服务器,我可以将 gem 发布到其中

发布于 2024-10-26 10:52:34 字数 327 浏览 0 评论 0原文

我已经使用 Gemcutter 编写了一些 gem,并将其发布到 ruby​​gems,源代码存储在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜夜流光相皎洁 2024-11-02 10:52:34

如果您有一台可以托管您的私人宝石的服务器,那么这相当简单。设置一个子域,例如 gems.companyname.com 并设置一个虚拟主机来托管您的域。您可以将该虚拟主机指向一个文件夹,就像您指向任何网站一样,然后从那里设置 gem 服务器。

示例:

mkdir /var/www/gemserver
mkdir /var/www/gemserver/gems
cp private-gem-0.1.0.gem /var/www/gemserver/gems
cd /var/www/gemserver
gem generate_index

/var/www/gemserver 将是根目录。最后,您需要做的就是向您的 Gemfile 添加新的源,

source 'http://rubygems.org'
source 'http://gems.companyname.com'

以便任何了解您的自定义域的人都可以访问 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:

mkdir /var/www/gemserver
mkdir /var/www/gemserver/gems
cp private-gem-0.1.0.gem /var/www/gemserver/gems
cd /var/www/gemserver
gem generate_index

/var/www/gemserver would be the root directory. Lastly all you'd need to do is add a new source to your Gemfile

source 'http://rubygems.org'
source 'http://gems.companyname.com'

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文