0
votes

I've followed the installation instructions for spork-rails

I couldn't get bundle exec spork to run and got the error

/opt/local/bin/spork:23:in `load': cannot load such file -- /opt/local/lib/ruby1.9/gems/1.9.1/gems/spork-1.0.0rc3/bin/spork (LoadError)
from /opt/local/bin/spork:23:in `<main>'

I am in /opt/local/lib/ruby1.9/gems/1.9.1/gems/spork-1.0.0rc3/bin/spork 's group and its permissions are 711.

Running sudo bundle exec spork works but when I then run bundle exec rspec spec it still takes 8+ seconds to load

I'm running:
ruby 1.9.3
rails 3.2.3
spork 1.0.0rc3
spork-rails 3.2.0
rspec 2.10.1
OSX 10.7.4
Installed with macports

UPDATE I've uninstalled macports ruby and reinstalled with rvm

This is allowing me todo bundle exec sport without sudo, but bundle exec rspec spec is still taking +8s to run

3
did you install it with sudo bundle install (you should never do that) ?Frederick Cheung
No but bundle install does ask me for my sudo password, is that as bad?msaspence
@msaspence Yes. You shouldn't ever need to use sudo for gem-related commands if you're using RVM or rbenv.Andrew Marshall
since uninstalling macports ruby and ruby gem and reinstalling with rvm I haven't, however rspec still not connecting to sporkmsaspence

3 Answers

3
votes

when you run rspec you need to pass in the argument "--drb" rspec --drb spec/

3
votes

You could also take a look at spin, which does the same but is a lot easier to setup and less intrusive.

1
votes

In addition to the YaBoyQuy's answer you can add the --drb option in your .rspec and forget it. Here the content of my .rspec file:

--drb
--colour
--order=random

(Note I've added the --order=rand option that make rspec run tests in random order which is a good thing because your tests should not depend on each other)