加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails-3 – 为什么在Bundler之外运行Guard是危险的?

发布时间:2020-12-17 07:09:32 所属栏目:百科 来源:网络整理
导读:当我运行捆绑exec后卫时,一切都是犹太洁食,但如果我试图守卫,我会得到这个: WARNING: You are using Guard outside of Bundler,this is dangerous and could not work. Using `bundle exec guard` is safer. 为什么是这样? 解决方法 来自bundler official
当我运行捆绑exec后卫时,一切都是犹太洁食,但如果我试图守卫,我会得到这个:

WARNING: You are using Guard outside of Bundler,this is dangerous and could not work. Using `bundle exec guard` is safer.

为什么是这样?

解决方法

来自bundler official site:

Run an executable that comes with a gem in your bundle

$bundle exec rspec spec/models

In some cases,running executables without bundle exec may work,if
the executable happens to be installed in your system and does not
pull in any gems that conflict with your bundle.

However,this is unreliable and is the source of considerable pain.
Even if it looks like it works,it may not work in the future or on
another machine. If you want a way to get a shortcut to gems in your
bundle

$bundle install --binstubs $bin/rspec spec/models

The executables installed into bin are scoped to the bundle and will
always work

我不确定是否有任何关于守卫的具体内容,但一般来说,通过bundle exec运行所有宝石的可执行文件是一个好习惯.也许他们只是决定警告开发人员,没有它可以运行警卫可能会造成麻烦(例如,如果你的系统和Gemfile中有不同版本的后卫).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读