0
votes

Im trying to initialize guard gem to work with rspec and getting error. Simple way to repeat this error (ruby 2.1.5, rails 4.1.8, Windows 7 x64):

  1. rails new sample_app
  2. include " gem 'guard-rspec' " in gemfile
  3. bundle update
  4. bundle install
  5. bundle exec guard init rspec

It supposed to write something like this:

Writing new Guardfile to /Users/mhartl/rails_projects/sample_app/Guardfile rspec guard added to Guardfile, feel free to edit it

And generate a Guardfile. Getting output:

D:\Programming\Projects\Ruby\Rails\sample_app>bundle exec guard init rspec
D:/Programming/Programs/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/guard-2.12.2/bin/guard:18:in `spawn': Exec forma
t error - D:/Programming/Programs/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/guard-2.12.2/bin/_guard-core (Errno::E
NOEXEC)
        from D:/Programming/Programs/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/guard-2.12.2/bin/guard:18:in `ignor
e_interrupts'
        from D:/Programming/Programs/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/guard-2.12.2/bin/guard:27:in `<top
(required)>'
        from D:/Programming/Programs/RailsInstaller/Ruby2.1.0/bin/guard:23:in `load'
        from D:/Programming/Programs/RailsInstaller/Ruby2.1.0/bin/guard:23:in `<main>'

No files generated. Gemfile(rails new app + guard-rspec):

source 'https://rubygems.org'

gem 'guard-rspec'

gem 'rails', '4.1.8'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0',          group: :doc

gem 'tzinfo-data', platforms: [:mingw, :mswin]
1

1 Answers

0
votes

Turns out, that guard 2.12.2 is not working. I was have to roll back from version to version and finally 2.11.1 is worked just fine. So gemfile lines looks like this:

...
  gem 'guard-rspec'
  gem 'guard', '2.11.1'
...