错误 - 无法加载'guard / rails-assets'或''查找类Guard :: RailsAssets(Rails 4 / zeus / guard)

时间:2014-12-02 16:35:28

标签: ruby-on-rails ruby ruby-on-rails-3 guard zeus

我有一个没有问题的正在运行的应用程序,现在只进行了捆绑更新和捆绑安装。我认为过去4个月没有更新更新。

现在当我运行$ guard时,我有这样的错误:错误 - 无法加载'guard / rails-assets'或''find class Guard :: RailsAssets

我不明白这个bug来自哪里:我认为是捆绑更新导致问题在我没有问题之前10分钟,但我不是100%肯定。

mathieu-To-be-filled-by-O-E-M:~/rails_projects/mathieu_app$ guard
17:30:40 - ERROR - Could not load 'guard/rails-assets' or'    ' find class Guard::RailsAssets
17:30:40 - ERROR - Error is: cannot load such file -- guard/guard
17:30:40 - ERROR - /home/mathieu/.rvm/gems/ruby-2.0.0-p451@global/gems/guard-rails-assets-0.1.5/lib/guard/rails-assets.rb:2:in `require'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@global/gems/guard-rails-assets-0.1.5/lib/guard/rails-assets.rb:2:in `<top (required)>'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard/plugin_util.rb:105:in `require'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard/plugin_util.rb:105:in `rescue in plugin_class'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard/plugin_util.rb:97:in `plugin_class'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard/plugin_util.rb:56:in `initialize_plugin'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard/internals/plugins.rb:24:in `add'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard/dsl.rb:186:in `block in guard'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard/dsl.rb:183:in `each'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard/dsl.rb:183:in `guard'
> [#] /home/mathieu/rails_projects/mathieu_app/Guardfile:37:in `evaluate'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard/dsl.rb:378:in `instance_eval'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard/dsl.rb:378:in `evaluate'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard/guardfile/evaluator.rb:91:in `evaluate'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard.rb:155:in `_evaluate'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard.rb:60:in `setup'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard/commander.rb:32:in `start'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard/cli.rb:243:in `_start'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard/cli.rb:108:in `start'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard/aruba_adapter.rb:32:in `execute'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/lib/guard/aruba_adapter.rb:19:in `execute!'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/gems/guard-2.10.1/bin/guard:11:in `<top (required)>'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/bin/guard:23:in `load'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/bin/guard:23:in `<main>'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/bin/ruby_executable_hooks:15:in `eval'
> [#] /home/mathieu/.rvm/gems/ruby-2.0.0-p451@rails3tutorial2ndEd/bin/ruby_executable_hooks:15:in `<main>'
17:30:40 - ERROR - Invalid Guardfile, original error is: 
> [#] 
> [#] Could not load class: "RailsAssets", 
> [#] backtrace: 
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.10.1/lib/guard/plugin_util.rb:57:in `initialize_plugin'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.10.1/lib/guard/internals/plugins.rb:24:in `add'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.10.1/lib/guard/dsl.rb:186:in `block in guard'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.10.1/lib/guard/dsl.rb:183:in `each'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.10.1/lib/guard/dsl.rb:183:in `guard'
> [#]   (dsl)> ./Guardfile:37:in `evaluate'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.10.1/lib/guard/dsl.rb:378:in `instance_eval'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.10.1/lib/guard/dsl.rb:378:in `evaluate'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.10.1/lib/guard/guardfile/evaluator.rb:91:in `evaluate'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.10.1/lib/guard.rb:155:in `_evaluate'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.10.1/lib/guard.rb:60:in `setup'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.10.1/lib/guard/commander.rb:32:in `start'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.10.1/lib/guard/cli.rb:243:in `_start'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.10.1/lib/guard/cli.rb:108:in `start'
> [#]   (dsl)> $GEM_PATH[0]/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
> [#]   (dsl)> $GEM_PATH[0]/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
> [#]   (dsl)> $GEM_PATH[0]/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
> [#]   (dsl)> $GEM_PATH[0]/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.10.1/lib/guard/aruba_adapter.rb:32:in `execute'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.10.1/lib/guard/aruba_adapter.rb:19:in `execute!'
> [#]   (dsl)> $GEM_PATH[0]/gems/guard-2.10.1/bin/guard:11:in `<top (required)>'
> [#]   (dsl)> $GEM_PATH[0]/bin/guard:23:in `load'
> [#]   (dsl)> $GEM_PATH[0]/bin/guard:23:in `<main>'
> [#]   (dsl)> $GEM_PATH[0]/bin/ruby_executable_hooks:15:in `eval'

修改

我现在收到一种新类型的错误:请参阅here

1 个答案:

答案 0 :(得分:1)

Guard::RailsAssets是一个古老的宝石,我在此发送了拉取请求:https://github.com/dnagir/guard-rails-assets/pull/28

如果您不想等待发布,只需将其放入Gemfile

gem 'guard-rails-assets', github: 'guard/guard-rails-assets', ref: '7500dc3'

如果您对此有任何疑问,请对上面的提款请求发表评论。

干杯