Why is a dangerous guard outside a traveler dangerous?

When I run bundle exec guard , everything is kosher, but if I try to start guard , I get the following:

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

Why is this?

+4
source share
1 answer

From bundler official website :

Run the executable that comes with the gem in your package

$ bundle exec rspec spec/models

In some cases, executing executable files without the exec package may work if the executable is installed on your system and does not pull on any gems that conflict with your package.

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

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

Executables installed in bin are bundled and will always work

I'm not sure if there is anything special about guard , but overall it is good practice to run all the executables of your gems through bundle exec . Maybe they just decided to warn the developers that starting guard without this could cause problems (for example, if your system has different versions of guard and Gemfile ).

+2
source

Source: https://habr.com/ru/post/1392246/


All Articles