Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot load such file -- guard/compat/plugin (LoadError) #39

Open
cornuwel opened this issue Oct 13, 2019 · 4 comments
Open

cannot load such file -- guard/compat/plugin (LoadError) #39

cornuwel opened this issue Oct 13, 2019 · 4 comments

Comments

@cornuwel
Copy link

Hi,

Guard works fine with rspec. bundle exec cucumber also works fine.
But if I launch guard with a cucumber configuration, I get the following error:

cannot load such file -- guard/compat/plugin (LoadError)

guard (2.15.0)
guard-compat (1.2.1)
guard-cucumber (1.5.4)
guard-rspec (4.7.3)
cucumber-rails (1.8.0)
rspec-rails (3.9.0)
cucumber (3.1.2)
rspec (3.9.0)

At first, I thought it came from my configuration, but even deleting the GuardFile and letting guard init cucumber generate a new one didn't fix the issue.

guardStacktrace.txt

@paolobrasolin
Copy link

The error raises from this require:

require "guard/compat/plugin"

I think the problem is that since 4c7d0e4#diff-d50e953cbce7c1199925fc21000b3fb9 guard-cucumber adds guard-compat as a development dependency instead of a regular dependency as the guard-compat documentation suggests: https://github.com/guard/guard-compat/blob/0e32e9bff1c896ff2c210d5f2658c55e673f3f49/README.md#usage-in-a-guard-plugin. (cc @todd-a-jacobs)

A simple workaround is adding guard-compat to your Gemfile, @cornuwel.

@cornuwel
Copy link
Author

Thank you very much. I can confirm the workaround works.
For future reference, here it is:

group :development do
  gem 'guard-compat'
  gem 'guard-rspec', require: false
  gem 'guard-cucumber'
  ...
end

todd-a-jacobs added a commit to todd-a-jacobs/guard-cucumber that referenced this issue Jun 7, 2020
todd-a-jacobs added a commit to todd-a-jacobs/guard-cucumber that referenced this issue Jun 7, 2020
- increment patch version
- fixes guard#39
@todd-a-jacobs
Copy link

Thanks for pinging me with this, @paolobrasolin. I also appreciate you narrowing down part of the problem.

I think the problem is that...guard-cucumber adds guard-compat as a development dependency instead of a regular dependency as the guard-compat documentation suggests[.]

This may be part of the problem, but it shouldn't be, since guard-compat says:

Currently, [guard-compat] provides only a test helper for testing custom Guard plugins.

I wouldn't expect a test helper to be required as a runtime dependency, but guard-cucumber might be making use of it somewhere I haven't looked yet. That said, I've hopefully patched the issue for Cucumber versions below 4.x.

@todd-a-jacobs
Copy link

Pull request #40 should close this issue when merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants