Guard-Spork ERROR in Rails Tutorial Section 3.6
Plodding away through Chapter 3 of Hartl's Ruby on Rails Tutorial, I completed the meat of this section (building static pages and "our first tests") with ease.
Being the overachiever that I am, and wanting to leave no stone unturned, I opted to try the exercises and advanced setup options at the end of the chapter. In full-disclosure, I only did the first 2 of the 3 exercises as #3 seemed a bit out of my current comfort zone.
In the Advanced Setup options of section 3.6, I skipped the first (Eliminating "bundle exec") because it seemed potentially problematic without RVM, which unfortunately is not available for Windows. I moved right into "Automated Tests with Guard" and "Speeding Up Tests with Spork".
I got through these with relatively little difficulty, but did encounter two errors, one of which I was able to resolve. The other is still unanswered, so feel free to email/or comment, if you know whattup!
The first issue I encountered was when running the command "time bundle exec rspec spec/requests/static_pages_spec.rb --drb," I got the following message in my command window "The system cannot accept the time entered. Enter the new time:" This remains unresolved, but I assume this implies that my Windows command prompt is not interpreting the "time" command the way the Tutorial expects. I'm not sure about this one so, feel free to shed some light on this.
The second and bigger issue (I think) was at the end of section 3.6.2 "Guard with Spork". Running "bundle exec guard" yielded the error "ERROR: Guard::Spork failed to achieve its <start>, exception was: NotImplementedError: fork() function is unimplemented on this machine."
After doing a little research, I determined via Thibaud Guillaume-Gentil, the creator of Guard, that because "fork" isn't implemented on Windows, "guard-spork" won't work on my system.
To side-step this issue and move forward, I needed to comment out the guard-spork gem in my gemfile:
# gem 'guard-spork', '0.3.2'
and comment out the two guard-spork sections of my guardfile:
# guard 'spork', :rspec_env => { 'RAILS_ENV' => 'test' } do
# watch('config/application.rb')
# watch('config/environment.rb')
# watch(%r{^config/environments/.+\.rb$})
# watch(%r{^config/initializers/.+\.rb$})
# watch('Gemfile')
# watch('Gemfile.lock')
# watch('spec/spec_helper.rb')
# watch('test/test_helper.rb')
# watch('spec/support/')
# end
and
# guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
# watch('config/application.rb')
# watch('config/environment.rb')
# watch(%r{^config/environments/.+\.rb$})
# watch(%r{^config/initializers/.+\.rb$})
# watch('Gemfile')
# watch('Gemfile.lock')
# watch('spec/spec_helper.rb')
# watch('test/test_helper.rb')
# end
Was the above "fix" able to help anyone else out who's using Windows? Anyone know what's up with the "time bundle exec" command failure?











