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

invalid guardfile - no block given #322

Closed
ElijahLynn opened this issue Sep 7, 2012 · 3 comments
Closed

invalid guardfile - no block given #322

ElijahLynn opened this issue Sep 7, 2012 · 3 comments

Comments

@ElijahLynn
Copy link

Everything appears to be running fine but I am getting an annoying error (https://gist.github.com/3661622).

Any ideas?

Guardfile is this - https://gist.github.com/3661100#file_gistfile1.rb

@netzpirat
Copy link
Contributor

This has nothing to to with Guard, the problem is (as the error message says), that with Ruby 1.8.7 the Find.find method must take a block. Only newer Rubies returns an enumerator:

$ rvm use ruby-1.9.3-p194
$ pry 
[1] pry(main)> require 'find'
=> true
[2] pry(main)> Find.find(Dir.pwd)
=> #<Enumerator: ...>
[3] pry(main)> ^D

$ rvm use ruby-1.8.7-p358
$ pry
[1] pry(main)> require 'find'
=> true
[2] pry(main)> Find.find(Dir.pwd)
LocalJumpError: no block given
from /Users/michi/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/find.rb:39:in `find'
[3] pry(main)> ^D

So either use to a newer Ruby version or rewrite the Guard condition.

@ElijahLynn
Copy link
Author

Even though this wasn't anything to do with Guard I want to let you know I very much appreciate your explanation and example, it is very helpful.

Thank you

@netzpirat
Copy link
Contributor

You're welcome. Solving little puzzles like this is relaxing and it makes me a better Ruby programmer with every issue :P

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