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

Version 0.5.0 fails to run #66

Closed
shmeltex opened this issue Apr 18, 2013 · 7 comments
Closed

Version 0.5.0 fails to run #66

shmeltex opened this issue Apr 18, 2013 · 7 comments

Comments

@shmeltex
Copy link

After upgrading to version 0.5.0, rubocop started to fail with the following error:

xxxx$ rubocop app
/Users/xxxx/.rvm/gems/ruby-2.0.0-p0/gems/rubocop-0.5.0/lib/rubocop/cli.rb:182:in `block in ruby_files': invalid byte sequence in UTF-8 (ArgumentError)
    from /Users/xxxx/.rvm/gems/ruby-2.0.0-p0/gems/rubocop-0.5.0/lib/rubocop/cli.rb:180:in `select'
    from /Users/xxxx/.rvm/gems/ruby-2.0.0-p0/gems/rubocop-0.5.0/lib/rubocop/cli.rb:180:in `ruby_files'
    from /Users/xxxx/.rvm/gems/ruby-2.0.0-p0/gems/rubocop-0.5.0/lib/rubocop/cli.rb:157:in `block in target_files'
    from /Users/xxxx/.rvm/gems/ruby-2.0.0-p0/gems/rubocop-0.5.0/lib/rubocop/cli.rb:155:in `each'
    from /Users/xxxx/.rvm/gems/ruby-2.0.0-p0/gems/rubocop-0.5.0/lib/rubocop/cli.rb:155:in `target_files'
    from /Users/xxxx/.rvm/gems/ruby-2.0.0-p0/gems/rubocop-0.5.0/lib/rubocop/cli.rb:44:in `run'
    from /Users/xxxx/.rvm/gems/ruby-2.0.0-p0/gems/rubocop-0.5.0/bin/rubocop:13:in `block in <top (required)>'
    from /Users/xxxx/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
    from /Users/xxxx/.rvm/gems/ruby-2.0.0-p0/gems/rubocop-0.5.0/bin/rubocop:12:in `<top (required)>'
    from /Users/xxxx/.rvm/gems/ruby-2.0.0-p0/bin/rubocop:23:in `load'
    from /Users/xxxx/.rvm/gems/ruby-2.0.0-p0/bin/rubocop:23:in `<main>'
    from /Users/xxxx/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/xxxx/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `<main>'

Version 0.4.6 worked with no issues on the same set of source code.

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 18, 2013

Maybe @lee-dohm can have a look at the problem? 0.5.0 runs fine on all codebases I've tested it on.

@shmeltex
Copy link
Author

The error caused by having binary file without extension in one of the sub-directories

@cschramm
Copy link
Contributor

I've had this too due to old stuff in my tmp directory. Clearing it fixed the problem.

@bf4
Copy link
Contributor

bf4 commented Apr 18, 2013

Fixed in #67 (and see #69 for good measure)

@lee-dohm
Copy link

I think @bf4 has the right solution, catch the issues and return false ... logging on debug of course.

@bf4
Copy link
Contributor

bf4 commented Apr 19, 2013

@lee-dohm Thanks. And since this part of the code is really only checking if a file without a .rb extension contains ruby code, I thought that unreadable or unparseable file could be safely ignored. Perhaps instead of STDERR we should use a logger, but that is besides the point of getting the thing to work... It can be put off till a future iteration.

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 19, 2013

Thanks for looking into that @bf4! Btw, you could have simply used warn :-)

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

5 participants