【问题标题】:Get rid of Guard bundler warning摆脱 Guard bundler 警告
【发布时间】:2012-07-19 17:16:53
【问题描述】:

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

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?我曾与更有经验的测试开发人员合作过,他们以前设法摆脱了这个警告,但我似乎无法弄清楚。

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3.2 guard


    【解决方案1】:

    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。

    【讨论】:

    • gem 解决方案很有趣
    猜你喜欢
    • 1970-01-01
    • 2016-01-15
    • 2016-11-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-16
    • 2017-01-25
    相关资源
    最近更新 更多