guard / guard-rspec

Guard::RSpec automatically run your specs (much like autotest)

Home Page:https://rubygems.org/gems/guard-rspec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Your RSpec.configuration.pattern uses characters unsupported by your Ruby version (File::FNM_EXTGLOB is undefined) (Guard::RSpecFormatter::Error::UnsupportedPattern)

budmc29 opened this issue · comments

I get this error when I run guard-rspec 4.6.4, with rspec 3.3 and spring 1.4.0.

My working environment is Ruby 1.9.3, Rails 3.2.1 on Ubuntu 14.04 x86.

I could not find any solution to this except using guard-rspec 4.3.0

Full errors:

/home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb:74:in `spec_path?': Your RSpec.configuration.pattern uses characters unsupported by your Ruby version (File::FNM_EXTGLOB is undefined) (Guard::RSpecFormatter::Error::UnsupportedPattern)
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb:52:in `extract_spec_location'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb:114:in `block in _failed_paths'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb:114:in `map'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb:114:in `_failed_paths'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb:101:in `block in write_summary'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb:108:in `open'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb:108:in `_write'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb:99:in `write_summary'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb:88:in `dump_summary'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:184:in `block in notify'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:183:in `each'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:183:in `notify'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:162:in `block in finish'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:170:in `close_after'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:151:in `finish'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb:79:in `report'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:113:in `run_specs'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:89:in `run'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:73:in `run'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:41:in `invoke'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/rspec-core-3.3.2/exe/rspec:4:in `<top (required)>'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `block in load'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
  from /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/spring-commands-rspec-1.0.4/lib/spring/commands/rspec.rb:18:in `call'
  from /home/user_name/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require'
  from /home/user_name/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require'
  from -e:1:in `<main>'
15:59:19 - ERROR - Failed: "bundle exec spring rspec -f progress -r /home/user_name/.rvm/gems/ruby-1.9.3-p551@rvm_name/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb -f Guard::RSpecFormatter --failure-exit-code 2  spec/controllers/blogs_controller_spec.rb" (exit code: 1)

It's as the error says:

Your RSpec.configuration.pattern uses characters unsupported by your Ruby version (File::FNM_EXTGLOB is undefined)

I should've made the error more specific I guess.

If you can, upgrade from Ruby 1.9.2 to at least Ruby 2.x.

If not, you should set the patterns value in your RSpec configuration (spec_helper.rb) to something that doesn't need Ruby 2.x functionality, e.g.:

RSpec.configure do |config|
    config.pattern = "**/*_spec.rb"
end

(The default pattern is **{,/*/**}/*_spec.rb, but it contains the { and } - which your Ruby (1.9.3) doesn't support in fnmatch - see here: http://www.rubydoc.info/stdlib/core/File.fnmatch).

Thanks for the tips. I will do that.

I opened the issue because it says that it was tested with ruby 1.9.3 and the guardfile was generated by the gem, so it should work out of the box.

Maybe can you do something for us that can only work with legacy applications, or maybe include somewhere in the readme the last version that is fully compatible with 1.9.3?
I spent 3 hours to figure this out, and maybe we can spare the poor guys that will share the same problems like me in the future.

Support for Ruby 1.9.3 ended in February this year - and upgrading to Ruby 2.2.0 should be very straightforward.

I opened the issue because it says that it was tested with ruby 1.9.3

Thanks, I've updated the Readme to avoid confusion.

I spent 3 hours to figure this out

That happens often with complex issues like this - sorry to hear about that. (I hate it when it happens to me too). I did think the error would explain the problem well enough (I knew exactly what was wrong the moment I saw the title of this issue).

Maybe can you do something for us that can only work with legacy applications

I hit legacy issues all the time. What I can suggest is first update Ruby to the newest possible. Then update test tools (and specs) to the newest tools possible. Then try RuboCop to get a sense of which areas could be the most problematic. Then update remaining gems to as newest as possible, without going crazy with codebase changes. And only then work on maintenance.

(Otherwise working on legacy apps can get very frustrating very quickly - the frustration is never worth the time saved, and every time you hit an issue like this, it will cost hours and hours of more frustration).

Thanks for reporting this - I'm sure people will find this issue by Googling from now on.

If it makes you happier - think of the guy before who had the SAME problem ... and DIDN'T get ANY error. It took us both lots of time to figure it out.

Great, thank for the time to explain.
Keep up the good work, this gem is indispensable.