在Ruby on Rails中,是否将供应商/ gems / somegem从一个项目复制到另一个项目,就像冻结gem一样? [英] In Ruby on Rails, is copying vendor/gems/somegem from one project to another project the same as freezing the gem?
问题描述
我被告知从
I was told that copying from
vendor/gems/somegem
从proj1到proj2的文件夹将基本冻结到项目中。 gem somegem
是一个内部gem,所以没有安装它的仓库。但我想知道它将如何与Rails 3一起工作,因为我们需要使用
from proj1 to proj2's folder will essentially freeze the gem into the project. The gem somegem
is an internal gem, so there is no repository to install it from. But I wonder how will it work with Rails 3, since we need to use
gem 'somegem'
在Gemfile中,假设当我们做一个 gem list
时,宝石的名字应该显示出来。什么是好的/正确的方法来做到这一点?感谢。
in the Gemfile, and supposedly when we do a gem list
, the name of the gem should show up. What is a good / proper way to do this? thanks.
推荐答案
我相信 Gemfile.lock
使用的宝石,以及任何和所有的依赖项,所以你可以基本上复制你的 Gemfile
和 Gemfile.lock
并运行 bundle install
I believe the Gemfile.lock
file stores the versions of the gems in use, along with any and all dependencies, so you can essentially copy over your Gemfile
and Gemfile.lock
and run bundle install
这篇关于在Ruby on Rails中,是否将供应商/ gems / somegem从一个项目复制到另一个项目,就像冻结gem一样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!