RVM:如何使用来自不同红宝石的宝石?

时间:2021-08-14 07:16:12

I have been using RVM to manage my Rubies and gems.

我一直在使用RVM来管理我的红宝石和宝石。

When I first installed RVM, the Ruby version that I installed was 1.9.2-p0. I recently installed Ruby 1.9.2-p136, which created a new Ruby in the RVM.

当我第一次安装RVM时,我安装的Ruby版本是1.9.2-p0。我最近安装了Ruby 1.9.2-p136,它在RVM中创建了一个新的Ruby。

My problem is I want to use the latest version of Ruby but all of the gems I installed were installed under the 1.9.2-p0 directory, because RVM keeps gems completely separate between Rubies, and I want to be able to use those gems with my new version, p-136 without having to reinstall them all.

我的问题是我想使用最新版本的Ruby,但我安装的所有宝石都安装在1.9.2-p0目录下,因为RVM保持宝石在Rubies之间完全分开,我希望能够使用这些宝石我的新版本,p-136而无需重新安装它们。

Is there a way I can get my gems from my p-0 Ruby to work with my p-136 Ruby?

有没有办法让我的p-0 Ruby可以使用我的p-136 Ruby?

4 个解决方案

#1


3  

You need to check out gemsets and export your current gems.

你需要检查gemsets并导出你当前的宝石。

rvm gemset export

Read the gemset docs for more information.

阅读gemset文档以获取更多信息。

#2


21  

You can use copy in rvm

你可以在rvm中使用copy

$ rvm gemset copy 1.9.2-p0 1.9.2-p136

See more about the rvm copy command

查看有关rvm copy命令的更多信息

This is the fastest way to get your gems moved over and it wont reinstall everything, just copy them over. But once you've got that squared away I'd do as the others are suggesting and start using gemsets. It's a nice way to group the gems you use in your projects.

这是让你的宝石移动的最快方法,它不会重新安装所有东西,只需复制它们。但是,一旦你得到那个平方,我会像其他人一样建议并开始使用gemsets。这是对您在项目中使用的宝石进行分组的好方法。

#3


5  

This might help: http://rvm.io/gemsets/initial/

这可能会有所帮助:http://rvm.io/gemsets/initial/

Basically, if you setup a global gemset configuration, those gems will be used for every ruby version you install.

基本上,如果您设置了全局gemset配置,那么这些gem将用于您安装的每个ruby版本。

#4


0  

You can copy a gemset from one ruby to another. rvm copy

您可以将gemset从一个ruby复制到另一个ruby。 rvm副本

$ rvm gemset copy 2.1.1@rails4 2.1.2@rails4

#1


3  

You need to check out gemsets and export your current gems.

你需要检查gemsets并导出你当前的宝石。

rvm gemset export

Read the gemset docs for more information.

阅读gemset文档以获取更多信息。

#2


21  

You can use copy in rvm

你可以在rvm中使用copy

$ rvm gemset copy 1.9.2-p0 1.9.2-p136

See more about the rvm copy command

查看有关rvm copy命令的更多信息

This is the fastest way to get your gems moved over and it wont reinstall everything, just copy them over. But once you've got that squared away I'd do as the others are suggesting and start using gemsets. It's a nice way to group the gems you use in your projects.

这是让你的宝石移动的最快方法,它不会重新安装所有东西,只需复制它们。但是,一旦你得到那个平方,我会像其他人一样建议并开始使用gemsets。这是对您在项目中使用的宝石进行分组的好方法。

#3


5  

This might help: http://rvm.io/gemsets/initial/

这可能会有所帮助:http://rvm.io/gemsets/initial/

Basically, if you setup a global gemset configuration, those gems will be used for every ruby version you install.

基本上,如果您设置了全局gemset配置,那么这些gem将用于您安装的每个ruby版本。

#4


0  

You can copy a gemset from one ruby to another. rvm copy

您可以将gemset从一个ruby复制到另一个ruby。 rvm副本

$ rvm gemset copy 2.1.1@rails4 2.1.2@rails4