我如何使用RVM并创建全球可用的宝石? [英] How do I use RVM and create globally available gems?

查看:88
本文介绍了我如何使用RVM并创建全球可用的宝石?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Mac OSX 10.6.4并安装了RVM。到目前为止,它非常棒,我真的很喜欢它让我管理多个版本的rails和ruby在同一台机器上而不会头疼的方式!



然而,我没有想要为每个设置安装某些宝石(例如乘客)。有没有办法在宝石之间分享宝石?我有一个1.8.7@rails2.3.8和1.9.2@rails3,我可以安装宝石,例如passenger,mysql和capistrano,并且可以安装所有版本吗?

解决方案

有一种叫做全局gemset的东西,它是在某个ruby版本的所有gems集之间共享的。但是你不能在Ruby之间共享宝石。

然而,你可以做的是创建一个gem列表,当添加一个新的ruby版本时会自动安装。这在此处有描述。简而言之:编辑名为〜/ .rvm / gemsets / global.gems 的文件,以包含每个ruby版本所需的宝石列表。



希望它有帮助。


I'm running Mac OSX 10.6.4 and have installed RVM. Its been great so far, I really love the way it lets me manage having multiple versions of rails and ruby on the same machine without headaches!

However, I don't want to have to install certain gems (such as passenger) for each setup. Is there a way to share gems between gemsets? I have a 1.8.7@rails2.3.8 and 1.9.2@rails3, can I have gems such as passenger, mysql, and capistrano installed once and used with all versions?

解决方案

There is something called the global gemset, and it is shared between all your gemsets of a certain ruby-version. But you can't share gems between ruby-versions.

However, what you can do is create a list of gems that will be installed automatically when adding a new ruby version. That is described here. In short: edit a file called ~/.rvm/gemsets/global.gems to contain the list of gems you want to be there for each ruby-version.

Hope it helps.

这篇关于我如何使用RVM并创建全球可用的宝石?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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