将RVM中的gemset导入Rails项目。

时间:2021-02-27 07:16:11

If I create a gemlist in RVM and then make a new rails project, can I fills the Rails project's Gemfile with the gems in that gemlist?

如果我在RVM中创建一个gemlist然后创建一个新的rails项目,我可以用该gemlist中的gem填充Rails项目的Gemfile吗?

2 个解决方案

#1


3  

You should export your Gemset using,

您应该使用导出Gemset,

rvm gemset export Gemfile

rvm gemset导出Gemfile

where gemset is the name of the Gemset you had created.

其中gemset是您创建的Gemset的名称。

RVM Gemsets https://github.com/wayneeseguin/rvm/issues/982

RVM Gemsets https://github.com/wayneeseguin/rvm/issues/982

#2


0  

I discovered the * question How do I change the default gemfile created with 'rails new' command? which, while not answering my question, divulges an approach which manages to implement the functionality I was searching for with my question - namely, for one to be able to use a user-specified list of gems to be incorporated into a new Rails project's Gemfile. Also, the answer was to look to "Application Templates" - see here in the Rails Guides: http://guides.rubyonrails.org/generators.html#application-templates

我发现了*问题如何更改使用'rails new'命令创建的默认gemfile?虽然没有回答我的问题,但却泄漏了一种方法,该方法设法实现我正在搜索的功能 - 我的问题 - 即,能够使用用户指定的宝石列表将其合并到新的Rails项目的Gemfile中。此外,答案是查看“应用程序模板” - 请参阅Rails指南:http://guides.rubyonrails.org/generators.html#application-templates

Stevanity's answer is relevant as well, because, although I didn't specifically mention in my original question that I was looking for a way to share lists of gems between gemlists, I was curious about that. Thanks!

Stevanity的回答也是相关的,因为虽然我在原始问题中没有特别提到我正在寻找一种方法来分享gemlists之间的宝石列表,但我很好奇。谢谢!

#1


3  

You should export your Gemset using,

您应该使用导出Gemset,

rvm gemset export Gemfile

rvm gemset导出Gemfile

where gemset is the name of the Gemset you had created.

其中gemset是您创建的Gemset的名称。

RVM Gemsets https://github.com/wayneeseguin/rvm/issues/982

RVM Gemsets https://github.com/wayneeseguin/rvm/issues/982

#2


0  

I discovered the * question How do I change the default gemfile created with 'rails new' command? which, while not answering my question, divulges an approach which manages to implement the functionality I was searching for with my question - namely, for one to be able to use a user-specified list of gems to be incorporated into a new Rails project's Gemfile. Also, the answer was to look to "Application Templates" - see here in the Rails Guides: http://guides.rubyonrails.org/generators.html#application-templates

我发现了*问题如何更改使用'rails new'命令创建的默认gemfile?虽然没有回答我的问题,但却泄漏了一种方法,该方法设法实现我正在搜索的功能 - 我的问题 - 即,能够使用用户指定的宝石列表将其合并到新的Rails项目的Gemfile中。此外,答案是查看“应用程序模板” - 请参阅Rails指南:http://guides.rubyonrails.org/generators.html#application-templates

Stevanity's answer is relevant as well, because, although I didn't specifically mention in my original question that I was looking for a way to share lists of gems between gemlists, I was curious about that. Thanks!

Stevanity的回答也是相关的,因为虽然我在原始问题中没有特别提到我正在寻找一种方法来分享gemlists之间的宝石列表,但我很好奇。谢谢!