Bundler does not work as advertised!

I changed some gem versions in my Gemfile, and then I did:

$ bundle install
Using rake (0.9.2)
Using abstract (1.0.0)
Using activesupport (3.0.9)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.9)
Using erubis (2.6.6)
Using rack (1.2.3)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.29)
Using actionpack (3.0.9)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.9)
Using mail (2.2.19)
Using actionmailer (3.0.9)
Using arel (2.0.10)
Using activerecord (3.0.9)
Using activeresource (3.0.9)
Using annotate (2.4.0)
Using bundler (1.0.15)
Using diff-lcs (1.1.2)
Using nokogiri (1.5.0)
Using rdoc (3.8)
Using thor (0.14.6)
Using railties (3.0.9)
Using rails (3.0.9)
Using rspec-core (2.0.1)
Using rspec-expectations (2.0.1)
Using rspec-mocks (2.0.1)
Using rspec (2.0.1)
Using rspec-rails (2.0.1)
Using spork (0.8.4) **********<<<<<<<<<<<
Using sqlite3-ruby (1.2.5)
Using webrat (0.7.1)
Your bundle is complete! Use bundle show [gemname] to see where a
bundled gem is installed.

Now I want to run spork 0.8.4 (as listed in the Gemfile):

$ bundle exec spork
/Users/Me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/spork-0.9.0.rc8/lib/spork/test_framework/cucumber.rb:2:
warning: already initialized constant DEFAULT_PORT
/Users/Me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/spork-0.9.0.rc8/lib/spork/test_framework/cucumber.rb:3:
warning: already initialized constant HELPER_FILE
/Users/Me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/spork-0.9.0.rc8/lib/spork/test_framework/rspec.rb:2:
warning: already initialized constant DEFAULT_PORT
/Users/Me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/spork-0.9.0.rc8/lib/spork/test_framework/rspec.rb:3:
warning: already initialized constant HELPER_FILE
Using RSpec
Loading Spork.prefork block…
Spork is ready and listening on 8989!

It appears to me that the spork version being executed is the version
that used to be in the Gemfile–not the version that is currently
specified in the gemfile. I don’t really care what version of spork
executes, but autotest stopped working when I updated some gems to newer
versions in my Gemfile, so I tried specifying all the old versions
again. Why doesn’t ‘bundle exec’ execute spork version 0.8.4?

And if I try:

$ spork -v
spork: version unknown

$ spork --help
Usage: spork [test framework name] [options]

Options:
-b, --bootstrap
-d, --diagnose
-h, --help
-p, --port [PORT]

Supported test frameworks:
( ) Cucumber
(*) RSpec

Legend: ( ) - not detected in project (*) - detected

What kind of idiot creates a gem that won’t give you its version??

Here is the autotest error(if that matters):

/Users/Me/.rvm/rubies/ruby-1.9.2-p180/bin/ruby -rrubygems -S
/Users/Me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.6.4/bin/rspec
–tty
‘/Users/Me/rails_projects/sample_app/spec/controllers/pages_controller_spec.rb’
‘/Users/Me/rails_projects/sample_app/spec/controllers/users_controller_spec.rb’
‘/Users/Me/rails_projects/sample_app/spec/models/user_spec.rb’
‘/Users/Me/rails_projects/sample_app/spec/requests/layout_links_spec.rb’
Exception encountered: #<OptionParser::InvalidOption: --tty>
backtrace:

On 16 July 2011 22:22, 7stud – [email protected] wrote:

bundled gem is installed.
What does
bundle show spork
show?

Colin

$ bundle show spork
/Users/Me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/spork-0.8.4

On Sat, Jul 16, 2011 at 2:30 PM, 7stud – [email protected] wrote:

$ bundle show spork
/Users/Me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/spork-0.8.4

Hi, please do the following:

$ bundle update spork
$ bundle exec spork

Good luck,

-Conrad

I get the same autotest error after doing that.

On Sat, Jul 16, 2011 at 5:08 PM, 7stud – [email protected] wrote:

I get the same autotest error after doing that.

Can you execute your tests without spork and autotest? If so, can you
execute your test with spork?

-Conrad

On Sun, Jul 17, 2011 at 2:10 AM, 7stud – [email protected] wrote:

If so, can you
execute your test with spork?

I don’t know what that means. In any case, I deleted my whole gemset
and started over, and now I can run autotest again.

I was trying to get you to go through a process of elimination.

-Conrad

Conrad T. wrote in post #1011168:

On Sat, Jul 16, 2011 at 5:08 PM, 7stud – [email protected] wrote:

I get the same autotest error after doing that.

Can you execute your tests without spork and autotest?

Yes.

If so, can you
execute your test with spork?

I never tried that. In the meantime, I deleted my whole gemset
and started over, and now I can run autotest again. Bundler does not
seem to work correctly. Altering my Gemfile with newer gem versions,
and then doing ‘bundle install’, followed by changing the gem versions
back to the older versions, and doing ‘bundle install’ causes autotest
to stop working. For some reason, Bundler cannot restore the same
environment when reverting back to older gem versions.