vcastellm / guard-go

Run and restart go programs when changed
MIT License
24 stars 13 forks source link

bundle exec guard init go throws error #20

Closed var23rav closed 6 years ago

var23rav commented 6 years ago

I am facing issue in initializing guard-go in windows. Other plugins work fine, I were able to use guard-sass. Details: OS: Windows ruby: ruby 2.4.3p205 (2017-12-14 revision 61247) [x64-mingw32]

please find the details Gemfile

source "https://rubygems.org"

group:development do 
    gem 'guard'
    gem 'guard-go'
    gem 'win32console'
    gem 'guard-sass'
end

I have installed the gem using bundle install.

But bundle exec guard init go throws error

11:04:08 - ERROR - Could not load 'guard/go' or '~/.guard/templates/go' or find class Guard::Go
 [#]

If i manually add the plugin code to Guardfile

guard 'go', :server => 'app.go' do
   watch(%r{\.go$})
 end

Then bundle exec guard give me an error like

11:10:45 - ERROR - Could not load 'guard/go' or find class Guard::Go
11:10:45 - ERROR - Error is: cannot load such file -- guard/guard
11:10:45 - ERROR - C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-go-0.0.4/lib/guard/go.rb:2:in `require'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-go-0.0.4/lib/guard/go.rb:2:in `<top (required)>'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard/plugin_util.rb:105:in `require'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard/plugin_util.rb:105:in `rescue in plugin_class'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard/plugin_util.rb:96:in `plugin_class'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard/plugin_util.rb:56:in `initialize_plugin'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard/internals/plugins.rb:26:in `add'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard/dsl.rb:185:in `block in guard'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard/dsl.rb:182:in `each'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard/dsl.rb:182:in `guard'
> [#] C:/Users/vaisr/Var23Workshop/Go/src/Prom/Guardfile:17:in `evaluate'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard/dsl.rb:377:in `instance_eval'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard/dsl.rb:377:in `evaluate'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard/guardfile/evaluator.rb:89:in `evaluate'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard.rb:134:in `_evaluate'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard.rb:49:in `setup'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard/commander.rb:32:in `start'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard/cli/environments/valid.rb:16:in `start_guard'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard/cli.rb:122:in `start'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard/aruba_adapter.rb:32:in `execute'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/lib/guard/aruba_adapter.rb:19:in `execute!'
> [#] C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/guard-2.14.2/bin/_guard-core:11:in `<main>'
11:10:45 - ERROR - Invalid Guardfile, original error is:
> [#]
> [#] Could not load class: "Go",
> [#] backtrace:
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C
> [#]   (dsl)> C

https://stackoverflow.com/questions/48636200/error-could-not-load-guard-go-or-guard-templates-go-or-find-class-guard

var23rav commented 6 years ago

As @e2 [mentioned](github https://github.com/guard/guard/issues/734#issuecomment-132241880), guard-go is outdated.

You could make it up and running, by downgrading gaurd to its lowest matching version. gem 'guard', '1.0.0'