gpt4 book ai didi

ruby-on-rails - 摆脱 Guard bundler 警告

转载 作者:行者123 更新时间:2023-12-04 18:16:37 25 4
gpt4 key购买 nike

我怎样才能摆脱这个警告(永久)

Guard here! It looks like your project has a Gemfile, yet you are running
`guard` outside of Bundler. If this is your intent, feel free to ignore this
message. Otherwise, consider using `bundle exec guard` to ensure your
dependencies are loaded correctly.

...无需运行 bundle exec guard每次我启动它?我曾与更有经验的测试开发人员合作过,他们以前设法摆脱了这个警告,但我似乎无法弄清楚。

最佳答案

Guard 检查您当前的工作目录是否包含 Gemfile并向您显示您想要摆脱的 Bundler 警告。已添加此警告,因为已在 Guard 问题跟踪器中提交了许多由错误 LOAD_PATH 引起的问题。 , 使用 Bundler 运行 Guard 可以解决大部分问题。

如果您在带有 Gemfile 的项目中使用 Guard ,您应该使用 Bundler 继续运行 Guard,前缀为 Guard 和 bundle exec或使用一些 binstub 解决方案。我在我的 ZSH 配置中使用了一个简单的别名 alias be=bundle exec我用 be guard 开始 Guard .如果您更喜欢 binstub 解决方案,我建议使用 Rubygems bundler :

gem install rubygems-bundler
gem regenerate_binstubs

如果您知道自己在做什么并且不想看到此消息,可以使用 --no-bundler-warning (或简称 -B )。如果您再也不想看到此消息,请创建别名 alias guard=guard -B .

关于ruby-on-rails - 摆脱 Guard bundler 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11551281/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com