简体   繁体   中英

guard init can not find such file error

I have installed guard jasmine-headless webkit but it is causing an error. From the output I think it's the only one.

Does anyone know how to fix this, so it can find the file.

This is the output:

→ guard init
/Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/pry-1.0.0.pre1/lib/pry/pry_class.rb:249: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
16:13:18 - INFO - Writing new Guardfile to /Users/redres/Desktop/mailtest/Guardfile
16:13:19 - INFO - jammit guard added to Guardfile, feel free to edit it
/Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/guard-2.4.0/lib/guard/plugin/base.rb:53:in `read': No such file or directory - /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/guard-jasmine-headless-webkit-0.3.2/lib/guard/jasmineheadlesswebkit/templates/Guardfile (Errno::ENOENT)
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/guard-2.4.0/lib/guard/plugin/base.rb:53:in `template'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/guard-2.4.0/lib/guard/plugin_util.rb:129:in `block in add_to_guardfile'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/guard-2.4.0/lib/guard/plugin_util.rb:126:in `open'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/guard-2.4.0/lib/guard/plugin_util.rb:126:in `add_to_guardfile'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/guard-2.4.0/lib/guard/guardfile/generator.rb:62:in `initialize_template'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/guard-2.4.0/lib/guard/guardfile/generator.rb:88:in `block in initialize_all_templates'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/guard-2.4.0/lib/guard/guardfile/generator.rb:88:in `each'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/guard-2.4.0/lib/guard/guardfile/generator.rb:88:in `initialize_all_templates'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/guard-2.4.0/lib/guard/guardfile.rb:39:in `initialize_all_templates'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/guard-2.4.0/lib/guard/cli.rb:167:in `init'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/guard-2.4.0/bin/guard:6:in `<top (required)>'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/bin/guard:23:in `load'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/bin/guard:23:in `<main>'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `eval'
    from /Users/redres/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `<main>'

Edit:

If I do find /Users/redres/.rvm/gems/ruby-1.9.3-p484 | grep Guardfile find /Users/redres/.rvm/gems/ruby-1.9.3-p484 | grep Guardfile I get lots of hits

The .rvm/gems folder also contains these folders twice ruby-1.9.3-p484@global and ruby-1.9.3-p484. If I list the ruby versions, I get current, default and current && default.

I try'd sudo chmod 777 -R /Users/redres/.rvm , but then I get chmod: -R: No such file or directory

The error says that the file /Users/redres/.rvm/gems/ruby-1.9.3-p484/gems/guard-jasmine-headless-webkit-0.3.2/lib/guard/jasmineheadlesswebkit/templates/Guardfile don't exists. Does it?

If yes, should be a permission problem.

If not, where the Guardfile should actually be? If you can't guess, try to run find /Users/redres/.rvm/gems/ruby-1.9.3-p484 | grep Guardfile find /Users/redres/.rvm/gems/ruby-1.9.3-p484 | grep Guardfile for a full list of where it can currently exists. Chances are that you are using the wrong gemset/ruby version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM