Bundler:我每次都必须使用相同的命令行选项吗?

发布于 2024-12-27 18:57:52 字数 844 浏览 3 评论 0原文

我在使用 Bundler 时遇到了一些问题,并有一段时间停止使用它。现在,我重新开始使用它,这次详细阅读了它,并决定这些是我应该运行的第一个命令:

bundle install --binstubs --path vendor
bundle package

我知道将来对 bundle 的调用会记住该路径,但是现在我已经用新的 gem 更新了 Gemfile,我应该运行...?

  1. bundle install - Bundler 会发现我已经缓存了其他 gem,并且我希望将可执行文件保存到 bin/。

  2. bundle install --local - Bundler 需要知道我想使用缓存的 gem,但会记住其他内容。 这不起作用(或者,更准确地说, ,不适合这种情况),只需使用 bundle install 并且它不会重新安装当前的 gem(尽管我已经看到它这样做了,这就是我问的原因)

  3. bundle install --local --binstubs - Bundler不会记得任何东西,我需要提供它。

  4. 我不知道的任何其他组合/命令。

然后,在此之后我需要重新运行 bundle package 吗? 我的实验表明,不需要重新运行 bundle package ,缓存会更新为新的宝石。

我确实阅读了文档(以及一些博客,尽管找到最新的博客非常困难),但这对我来说并不清楚。

非常感谢任何帮助。

I had some problems with Bundler and stopped using it for a while. Now, I'm getting back to using it, and read up on it more this time and decided these are the first commands I should run:

bundle install --binstubs --path vendor
bundle package

I know that future calls to bundle will remember the path, but now I've updated my Gemfile with a new gem, should I run...?

  1. bundle install - Bundler will work out that I already have the other gems cached, and I want executables to bin/.

  2. bundle install --local - Bundler needs to know I want to use the cached gems but remembers the other stuff. This doesn't work (or, more precisely, isn't for this situation), just use bundle install and it won't reinstall current gems (although I've seen it do that which is why I asked)

  3. bundle install --local --binstubs - Bundler isn't going to remember anything and I need to provide it.

  4. Any other combination/commands I'm not aware of.

And then, do I need to re-run bundle package again after this? My experiments show me that re-running bundle package is not required, the cache is updated with new gems.

I did read the docs, (and a couple of blogs, though finding up-to-date ones is quite difficult) but this isn't clear to me.

Any help is much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

把时间冻结 2025-01-03 18:57:52

某些选项被捆绑程序称为“记住的选项”,并存储在 .bundle/config 中。这些记住的选项不需要一次又一次地输入。

根据http://gembundler.com/man/bundle-install.1.html#REMEMBERED-OPTIONS,记住的选项是 --deployment--path , --binstubs, --without

Certain options are what bundler calls remembered options and are stored in .bundle/config. These remembered options don't need to be typed again and again.

According to the http://gembundler.com/man/bundle-install.1.html#REMEMBERED-OPTIONS, the remembered options are --deployment, --path, --binstubs, --without

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文