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

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

概述当我运行捆绑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 当我运行捆绑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中有不同版本的后卫).

总结

以上是内存溢出为你收集整理的ruby-on-rails-3 – 为什么在Bundler之外运行Guard是危险的?全部内容,希望文章能够帮你解决ruby-on-rails-3 – 为什么在Bundler之外运行Guard是危险的?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1272749.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-08
下一篇 2022-06-08

发表评论

登录后才能评论

评论列表(0条)

保存