Closed belgoros closed 12 years ago
Sorry, still can't manage the formatting :(
According to the following line in your log you've forgotten to bootstrap Spork:
/home/serge/Development/Ruby/test_projects/timetracking/features/support/env.rb has not been bootstrapped. Run spork --bootstrap to do so.
I've already seen that message and run the bootstrap, here tis he proof:
serge@serge-laptop:~/Development/Ruby/test_projects/timetracking$ spork --bootstrap
Using RSpec
Already bootstrapped!
serge@serge-laptop:~/Development/Ruby/test_projects/timetracking$
Here is what I get after that no changes, unfortunately):
serge@serge-laptop:~/Development/Ruby/test_projects/timetracking$ spork --bootstrap
Using RSpec
Already bootstrapped!
serge@serge-laptop:~/Development/Ruby/test_projects/timetracking$ guard
Please install libnotify gem for Linux notification support and add it to your Gemfile
Guard is now watching at '/home/serge/Development/Ruby/test_projects/timetracking'
Starting Spork for RSpec & Cucumber
Using RSpec
Using Cucumber
Preloading Rails environment
/home/serge/Development/Ruby/test_projects/timetracking/features/support/env.rb has not been bootstrapped. Run spork --bootstrap to do so.
Loading Spork.prefork block...
ERROR: Could not start Spork server for RSpec & Cucumber. Make sure you can use it manually first.
Guard::RSpec is running, with RSpec 2!
Running all features
Disabling profiles...
WARNING: No DRb server is running. Running features locally:
Preloading Rails environment
Spork is ready and listening on 8990!
Spork is ready and listening on 8989!
Feature: Login into the application
To enter the Timetracking application any user should first log in.
I had the same issue just now, by default spork --bootstrap only checks and bootstraps rspec and not cucumber. You need to run spork cucumber --bootstrap
Or, if you don't want to use cucumber, you can add cucumber => false to guard 'spork'
Another issue I ran into is that the wait time was too low for my slow machine to finish loading the code, so I added :wait => 50 to guard 'spork'
Thanks @giom, FYI the latest version (0.3.2) of guard-spork should fix the "too long start" issue (details here).
@Javix, does running spork cucumber --bootstrap
actually fixes the issue?
Bootstrap worked witout problems but no changes after all:
serge@serge-laptop:~/Development/Ruby/test_projects/timetracking$ spork cucumber --bootstrap
Using Cucumber
Bootstrapping /home/serge/Development/Ruby/test_projects/timetracking/features/support/env.rb.
Done. Edit /home/serge/Development/Ruby/test_projects/timetracking/features/support/env.rb now with your favorite text editor and follow the instructions.
serge@serge-laptop:~/Development/Ruby/test_projects/timetracking$ guard
Please install libnotify gem for Linux notification support and add it to your Gemfile
Guard is now watching at '/home/serge/Development/Ruby/test_projects/timetracking'
Starting Spork for RSpec & Cucumber
Using Cucumber
Using RSpec
Preloading Rails environment
Preloading Rails environment
Loading Spork.prefork block...
Loading Spork.prefork block...
ERROR: Could not start Spork server for RSpec & Cucumber. Make sure you can use it manually first.
Guard::RSpec is running, with RSpec 2!
Running all features
Disabling profiles...
WARNING: No DRb server is running. Running features locally:
Spork is ready and listening on 8990!
Spork is ready and listening on 8989!
Feature: Login into the application
To enter the Timetracking application any user should first log in.
Scenario: successful login # features/login.feature:4
Given the email 'admin@example.com' and the password 'admin' # features/step_definitions/login_steps.rb:1
@Javix as mentioned by @rymai above, the latest version (0.3.2) should fix the "Could not start" error you're seeing. Try running bundle update guard-spork
?
If you don't want to upgrade, as @glom mentioned, you should be able to manually set the wait time. The readme file contains some information on this.
Do either of these steps fix your issue?
I've updated to 0.3.2
but I am still experiencing the issue.
> guard
Please install growl_notify or growl gem for Mac OS X notification support and add it to your Gemfile
Guard is now watching at '/Users/sorens/Dropbox/workspace/personal/naval_conflict'
Starting Spork for RSpec
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
ERROR: Could not start Spork server for RSpec after 30 seconds. I will continue waiting for a further 60 seconds.
ERROR: Could not start Spork server for RSpec. Make sure you can use it manually first.
Guard::RSpec is running, with RSpec 2!
Running all specs
Running tests with args ["--color", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/Users/sorens/.rvm/gems/ruby-1.9.2-p290@rails3/gems/guard-rspec-0.5.4/lib/guard/rspec/formatters/notification_rspec.rb", "spec"]...
......*...........*......................................
After the wait period has expired, it appears that everything startsup and runs fine. My Guardfile looks like
guard 'spork', :cucumber => false, :rspec_env => { 'RAILS_ENV' => 'test' } do
# stuff goes here
end
guard 'rspec', :version => 2, :cli => '--drb' do
# stuff goes here
end
I have run spork manually. I've used --bootstrap as well. If I run spork
, everything works fine. Even with those reported errors, spork starts up. I can modify Guardfile and guard-spork reports
Guardfile has been re-evaluated.
If I change a model, again guard-spork reports that my model has changed and re-runs those tests.
Running: spec/models/admin_user_spec.rb
In any event, I figured I would report the problem even though it seems fairly benign.
I am experiencing the same problem since updating from 0.3.1 to 0.3.2 two days ago. Start-up time has also increased dramatically (my current wait time of 90 seconds is not enough, where previously it took ~10 seconds to load my tiny app). As with @sorens, everything appears to be working fine, so this is more of an annoyance.
Edit: When it does finally start it sends a growl notification Test::Unit & RSpec NOT started
although RSpec runs immediately. I have tried using 0.3.1 again and there is no improvement.
Hi,
I'm sorry but if there is no improvement from downgrading to 0.3.1, I don't understand how, by upgrading to 0.3.2, your "Start-up time has also increased dramatically"!
Here is the comparison between 0.3.1 and 0.3.2: https://github.com/guard/guard-spork/compare/v0.3.1...v0.3.2 As you can see, there's no change that can increase the startup time of your app. Maybe the reason is elsewhere, don't you think? Maybe the problem is Spork, did you upgrade it recently?
After updating to 0.3.2. there still was a problem with time:
RROR: Could not start Spork server for RSpec & Cucumber after 30 seconds. I will continue waiting for a further 60 seconds.
So I added the option ':wait => 50' to guard sprok in the Guardfile and it seems to work now:
serge@serge-laptop:~/Development/Ruby/test_projects/timetracking$ guard
Please install libnotify gem for Linux notification support and add it to your Gemfile
Guard is now watching at '/home/serge/Development/Ruby/test_projects/timetracking'
Starting Spork for RSpec & Cucumber
Using RSpec
Using Cucumber
Preloading Rails environment
Preloading Rails environment
Loading Spork.prefork block...
Loading Spork.prefork block...
Spork is ready and listening on 8989!
Spork is ready and listening on 8990!
Spork server for RSpec & Cucumber successfully started
Guard::RSpec is running, with RSpec 2!
Running all features
Disabling profiles...
Running tests with args ["--no-profile", "--color", "--format", "pretty", "--strict", "--require", "/home/serge/.rvm/gems/ruby-1.9.2-head/gems/guard-cucumber-0.7.4/lib/guard/cucumber/notification_formatter.rb", "--format", "Guard::Cucumber::NotificationFormatter", "--out", "/dev/null", "--require", "features", "features"]...
Disabling profiles...
Feature: Login into the application
To enter the Timetracking application any user should first log in.
Scenario: successful login # features/login.feature:4
Given the email 'admin@example.com' and the password 'admin' # features/step_definitions/login_steps.rb:1
uninitialized constant User (NameError)
./features/step_definitions/login_steps.rb:2:in `/^the email 'admin@example.com' and the password 'admin'$/'
features/login.feature:5:in `Given the email 'admin@example.com' and the password 'admin''
When the user clicks on 'Log in' # features/step_definitions/login_steps.rb:5
Then the user enters to the application # features/step_definitions/login_steps.rb:10
Failing Scenarios:
cucumber features/login.feature:4 # Scenario: successful login
1 scenario (1 failed)
3 steps (1 failed, 2 skipped)
0m3.339s
Done.
@Javix, that's behaving as we intended - the error is there because we expected the spork servers to start within 30 seconds. The 60 second wait is intended to help you identify how long it is actually taking. Once spork actually starts, you should get a message saying how long it actually took.
@sorens yours looks more troubling - it should have detected spork was running by the looks of it. I've just run a test against my own config and it looks like it's working for me:
Starting Spork for RSpec & Cucumber
Using Cucumber
Using RSpec
Preloading Rails environment
Preloading Rails environment
Loading Spork.prefork block...
Loading Spork.prefork block...
Spork is ready and listening on 8989!
Spork is ready and listening on 8990!
Spork server for RSpec & Cucumber successfully started
Guard::RSpec is running, with RSpec 2!
Pow restarted.
The only obvious difference I can see is that you're only using RSpec, rather than RSpec + cucumber, but I've tried the same thing by running guard-spork against itself (yes, confusing I know, but it was the only non-cucumber project I had handy) which is RSpec only, and it's working there too. I take it this is something that happens every time? I assume your code is from a private project (i.e. it's not floating around on github somewhere?)
@rymai apologies, I was not clear on my edit - the start-up time issue is not related to the update to 0.3.2. I haven't updated spork, however, so I don't know what is causing it. If you would like to see any particulars of my setup just let me know - I am new to rails/ruby and do not know what you might need, and it is a private repo unfortunately.
@sorens, I've just executed your test project, and seeing the following:
Pauls-MacBook-Pro:sporkt paulrussell$ guard
Guard is now watching at '/Users/paulrussell/Documents/Work/3sixty/github/sporkt'
Starting Spork for Test::Unit & RSpec
Using RSpec
Couldn't find a supported test framework that begins with 'testunit'
Supported test frameworks:
( ) Cucumber
(*) RSpec
Legend: ( ) - not detected in project (*) - detected
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
ERROR: Could not start Spork server for Test::Unit & RSpec after 30 seconds. I will continue waiting for a further 60 seconds.
ERROR: Could not start Spork server for Test::Unit & RSpec. Make sure you can use it manually first.
[...]
...which indicates that guard-spork is trying (and failing) to wait for Test::Unit, since it is not in the Gemfile. When I change the project to remove test/test_support.rb
, which is how guard-spork detects which frameworks to use, then I get the following successful result:
Pauls-MacBook-Pro:sporkt paulrussell$ guard
Guard is now watching at '/Users/paulrussell/Documents/Work/3sixty/github/sporkt'
Starting Spork for RSpec
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
Spork server for RSpec successfully started
Guard::RSpec is running, with RSpec 2!
Running all specs
[...]
Sorens: Unless you're still seeing the issue r.e. the upgrade to 0.3.2 failing to detect a /correct/ startup, I'm inlined to suggest we close this issue, since I think the original issue was fixed by 0.3.2. Any objections?
@pauljamesrussell I commented out the watch for test/test_helper.rb and it works just as you said. Thanks for the help! I didn't create the issue, I just hijacked it when I was having the same issue :) but feel free to close.
Hey @pauljamesrussell, I've just started using Spork (it's awesome). I'm running version 0.3.2 with the line 'watch('test/test_helper.rb')' commented out (since I'm not using the relevant gem) and I'm having the same issue. I'll post the project for review within the next 48 hours so, just wanted to give you the heads up before closed the issue.
Also, I'm pretty new with new with giving feedback on other peoples gems, let me know if there's a better process. Thanks!
Removing the /test
folder entirely fixed the issue for me. There was no test_support.rb
file, the contents were:
test/test_helper.rb
test/performance/browsing_test.rb
I did have :testunit => false
in my Guardfile but it seems that didn't make any difference.
Thanks clearing that up @omnikron, remvoing the /test directory worked for me. Now I can startup Spork without any trouble. Not sure if other people will run into the same confusion, happy to make a note in the readme file or elsewhere if it would be helpful to others.
@reidreid46 feel free to submit a pull request with more info about this problem in the README. Thanks all!
@omnikron +1, worked great for me thanks!
@omnikron +1, thanks for the Help.. but what are the implications of removing it. are anything effected and why is it there in the first place.
@medampudi Test::Unit is the default test framework for rails. You don't need what you don't use.
@omnikron +1, removing the test
directory worked for me too. Thank you.
I found that I just needed to remove test/test_helper.rb from the test dir, which was otherwise empty, to make this work. rake test was working fine for me (essentially a no-op) so I'm puzzled why it should fail through guard-spork. In any case, that was my workaround. We're using rspec on this project but I'd still like to be able to use test:unit at some point. Cross that bridge at some point I suppose,
+1
+1
@omnikron +1
+1 removing the /test directory did the trick
+1
Removing /test directory worked for me too.
+1
But i need the /test direcotry because i use both rspec and test unit... And i still get the problem:
Spork is ready and listening on 8989! 09:45:28 - ERROR - Could not start Spork server for RSpec, Test::Unit after 30 seconds. I will continue waiting for a further 60 seconds.
09:46:28 - ERROR - Could not start Spork server for RSpec, Test::Unit. Make sure you can use it manually first.
+1
I can't figure out what's wrong in my configuration as I'am getting the following error:
Here is my Gemfile:
Guard file:
And at least, spec_helper.rb:
I'm on Ruby 1.9.2, Rails 3.1.1, Ubuntu 10.04. THANK YOU.