开发者

How does bundler work (in general)?

开发者 https://www.devze.com 2023-01-03 13:59 出处:网络
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 XYZand then use the Gemfile to pull a

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 XYZand 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 c开发者_运维百科onfused on what bundler's functionality is exactly.

-- MAP


These two links explain everything about bundler.

  • How does bundler bundle

  • How does bundle require gems


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号