当我运行时,bundle exec guard
一切都是犹太洁食,但如果我尝试运行,guard
我会得到:
WARNING: You are using Guard outside of Bundler, this is dangerous and could not work. Using `bundle exec guard` is safer.
为什么是这样?
当我运行时,bundle exec guard
一切都是犹太洁食,但如果我尝试运行,guard
我会得到:
WARNING: You are using Guard outside of Bundler, this is dangerous and could not work. Using `bundle exec guard` is safer.
为什么是这样?
来自bundler
官方网站:
运行捆绑包中附带 gem 的可执行文件
$ bundle exec rspec spec/models
在某些情况下,如果可执行文件恰好安装在您的系统中并且没有引入任何与您的捆绑包冲突的 gem,则运行不带 bundle exec 的可执行文件可能会起作用。
然而,这是不可靠的并且是相当大的痛苦的来源。即使它看起来可以正常工作,但将来或在另一台机器上可能无法正常工作。如果您想要一种方法来获取捆绑包中宝石的快捷方式
$ bundle install --binstubs $ bin/rspec spec/models
安装到 bin 中的可执行文件的范围仅限于捆绑包,并且将始终有效
我不确定是否有任何guard
关于bundle exec
. 可能他们只是决定警告开发人员在guard
没有它的情况下运行可能会导致麻烦(例如,如果您guard
的系统和Gemfile
.