捆绑机如何工作(一般)? [英] How does bundler work (in general)?
问题描述
gem install XYZ
,然后使用Gemfile来获取这些宝石的某个子集,以便与特定的应用程序一起使用?或者您是否不再正常安装gem,只需将它们包含在Gemfile中,然后执行 bundle install
将它们全部包含在随后与您的应用程序一起使用的包中? 非常感谢您抽出宝贵时间回答这个问题,我对捆绑程序的功能完全不知所措。
- MAP
将bundler视为一个包管理工具。
从 bundle help
命令:
$ b bundle install
code>#将当前环境安装到系统中
$ b
bundle package
#锁定并缓存所有gem into vendor / cache
因此 bundle install
命令会将所有gem安装到 system strong>在Gemfile中列出以及它们的依赖关系。如果以前没有安装宝石,它会从gemcutter repo中抓取宝石。 bundle package
会将.gem文件缓存到您的应用供应商/缓存目录中。
不需要先运行 gem install
。
I'm pretty new to Ruby/Rails but I was taking a look at bundler and was wondering how it works exactly. Do you install a full set of gems like normal gem install XYZ
and then use the Gemfile to pull a certain subset of those gems for use with a specific application? Or do you not install gems normally anymore and just include them in the Gemfile and then do a bundle install
to include them all in a bundle that is then used with your application?
Thank you so much for taking the time to answer this, I'm just a little confused on what bundler's functionality is exactly.
-- MAP
Think of bundler as a package management tool.
From bundle help
command:
bundle install
# Install the current environment to the system
bundle package
# Locks and then caches all of the gems into vendor/cache
So bundle install
command will install all gems to the system that are listed in Gemfile as well as their dependencies. If the gem was not previously installed it will grab it from the gemcutter repo. bundle package
will cache the .gem files into your apps vendor/cache directory.
No need to run gem install
first.
这篇关于捆绑机如何工作(一般)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!