Where does bundler store gems?

蓝咒 提交于 2019-11-29 23:29:46

It depends. In the usual development setup they are installed where they would be when you install a gem "normally" (by running gem install foo) and bundler won't reinstall gems that are already there. This location depends on how rubygems itself is configured.

If you run bundle install with the --deployment option then the gems will be installed in a location unique to your app (you can pass this as a separate option but it defaults to vendor/bundle)

You can also run bundle package to store all the .gem files your app uses in vendor/cache. Running bundle install will prefer gems in vendor/cache to gems in other locations.

If you want to find out where a particular gem is stored you can run bundle show <gem-name>. For example:

user@host$ bundle show rake
/var/bundle/ruby/2.1.0/gems/rake-10.4.2

Here /usr/local/lib/ruby/gems/2.1.0/gems/ and here: /usr/local/lib/ruby/gems/2.1.0/bundler/gems/.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!