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

Error: Guard will not detect changes to your Gemfile! #949

Open
Alien-97 opened this issue Nov 18, 2019 · 12 comments
Open

Error: Guard will not detect changes to your Gemfile! #949

Alien-97 opened this issue Nov 18, 2019 · 12 comments

Comments

@Alien-97
Copy link

I am trying to use Guard as a help for make Test Driven Development using Vim in Linux Shell. For add Guard dependecy, i added this to my .gemspec file:

spec.add_development_dependency "guard"

spec.add_development_dependency "guard-rspec"

spec.add_development_dependency "guard-bundler"

Then, in Command Line, i executed this:

sudo bin/setup

bundle exec guard init

Then for update Bundle gems and dependencies, i updated Bundle for take in count Guard files:

sudo bundle install

When i tried to use Guard with bundle exec guard, i got this error:

/usr/lib/ruby/vendor_ruby/did_you_mean/version.rb:2: warning: already initialized constant DidYouMean::VERSION
/var/lib/gems/2.6.0/gems/did_you_mean-1.3.1/lib/did_you_mean/version.rb:2: warning: previous definition of VERSION was here
/usr/lib/ruby/vendor_ruby/did_you_mean/jaro_winkler.rb:63: warning: already initialized constant DidYouMean::JaroWinkler::WEIGHT
/var/lib/gems/2.6.0/gems/did_you_mean-1.3.1/lib/did_you_mean/jaro_winkler.rb:63: warning: previous definition of WEIGHT was here

And for Guard output this warning:

 Error: Guard will not detect changes to your Gemfile!
> [#] 
> [#]   Solution: move the Gemfile to a watched directory and symlink it back.

I am searching a solution for this problem in guard public repository in Github, but until now i was unable to fix it.

Version of Ruby i am using : ruby 2.6.5

Version of guard: 2.16.1

Bundler version : 2.0.2

Here you can see Gemfile,Guardfile and gemspec

Any help would be appreciated, thanks.

@rymai
Copy link
Member

rymai commented Nov 19, 2019

It happens when Guard::Compat.watched_directories doesn't include the directory that includes the Gemfile. Can you try printing Guard::Compat.watched_directories in your Guardfile?

@Alien-97
Copy link
Author

Hello @rymai , thanks for the answer, i executed the Guard::Compat.watched_directories, this is the output:

[#<Pathname:/home/user/test7/gemtest>]

@rymai
Copy link
Member

rymai commented Nov 19, 2019

@Alien-97 Thanks, does your Gemfile is located at /home/user/test7/gemtest/Gemfile or elsewhere?

@Alien-97
Copy link
Author

Alien-97 commented Nov 19, 2019

@rymai Yes, it is located at gemtest directory.

@Alien-97
Copy link
Author

Hello @rymai , Do you figure out what is the error?

Thanks

@rymai
Copy link
Member

rymai commented Nov 20, 2019

@Alien-97 I've cloned your project locally but I don't manage to install your dependencies as there's no huella_nutricional/version.rb file:

› bundle install

[!] There was an error parsing `Gemfile`: 
[!] There was an error while loading `huella_nutricional.gemspec`: cannot load such file -- huella_nutricional/version
Does it try to require a relative path? That's been removed in Ruby 1.9. Bundler cannot continue.

 #  from /Users/remy/Desktop/Gemfile/huella_nutricional.gemspec:3
 #  -------------------------------------------
 #  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
 >  require "huella_nutricional/version"
 #  
 #  -------------------------------------------
. Bundler cannot continue.

 #  from /Users/remy/Desktop/Gemfile/Gemfile:4
 #  -------------------------------------------
 #  # Specify your gem's dependencies in huella_nutricional.gemspec
 >  gemspec
 #  
 #  -------------------------------------------

@Alien-97
Copy link
Author

@rymai , i give you access to this repo, there i commited all my gem files, for you can see better code structure and it's setup

@rymai
Copy link
Member

rymai commented Nov 21, 2019

@Alien-97 Thanks, I cloned your project, then ran bundle install, then bundle exec guard, and I got no error message. Also, if I modify the Gemfile, Guard says 10:03:27 - INFO - Bundle already up-to-date which means that the change detection was successful.

@Alien-97
Copy link
Author

@rymai ok, thanks, so i think that maybe there is something wrong with my gem versions or Ruby versions in my laptop.

@Alien-97
Copy link
Author

@rymai What version of Ruby do you use?

@rymai
Copy link
Member

rymai commented Nov 21, 2019

› ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]

@Alien-97
Copy link
Author

I have the same version

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

2 participants