简体   繁体   中英

Import a gemset from RVM into a Rails project.

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

You should export your Gemset using,

rvm gemset export Gemfile

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

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

I discovered the stackoverflow 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

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM