grosser / autotest

Save a file, autotest will run the matching tests! (Autotest without ZenTest)
121 stars 20 forks source link

Autotest and bundler don't get along #9

Closed tessro closed 13 years ago

tessro commented 14 years ago

When I try to run autotest under Rails 3.0.0.beta3/Rspec 2.0.0.beta8, I get:

$ autotest
(Not running features.  To run features in autotest, set AUTOFEATURE=true.)
loading autotest/rails_rspec2
Error loading Autotest style autotest/rails_rspec2 (no such file to load -- autotest/rails_rspec2). Aborting.

My rspec-rails gem is bundled (in ~/.bundle) rather than installed through rubygems. As a result, autotest doesn't find 'autotest/rails_rspec2' in its load path.

I am debating two solutions:

  1. Install rspec2.0.0.beta8 and related gems on my system
  2. Patch autotest to use Bundler when a Gemfile exists (c.f. config/boot.rb in Rails 3)

For now I'm using the first approach, despite not wanting to cloud my system with prerelease gems. I think the second approach is cleaner but I haven't been able to get it to work yet. It appears that calling Bundler.setup blows away the rubygems load path, causing other issues.

Hopefully this saves someone else some time. I had followed the instructions in gist.github.com/365816 and was still having problems since the gems were in ~/.bundle and not in my rubygems install dir.

grosser commented 14 years ago

my frist try would be bundle exec autotest, at least that should work

bartocc commented 14 years ago

I have bundler (1.0.0.beta.8) installed, and bundle exec autotest shouts Could not find bundler-1.0.0.beta.1 in any of the sources

grosser commented 14 years ago

hmm bundler is not hardcoded anywhere inside autotest, ill try if i can find something, does everything else work as expected e.g. bundle exec rake etc ?

probablykabari commented 13 years ago

Also, it doesn't seem like versions since 4.4.1 work with "bundle install". I'm experiencing this with one other gem as well so it's probably a bundler issue, but just so you know :)

grosser commented 13 years ago

can you post a simple example that shows how it does not work / is reproducible ? Im not able to make bundle install break as you descried :<

probablykabari commented 13 years ago

No problem. I'm using rvm (ruby version didn't seem to matter). This also isn't the only gem I had this issue with, a few others with new releases also seemed to stop working!

https://gist.github.com/672723

grosser commented 13 years ago

maybe the new -b / --bundle-exec flag can help

probablykabari commented 13 years ago

I think it was just my rubygems/rvm being totally busted. When I tried installing even regular gems, a completely random gem would get installed and not the gem I requested. ie:


~:ree1.8.7$ gem install arrayfields
Building native extensions.  This could take a while...
Successfully installed json-1.4.6
Successfully installed artforge-rtranslate-1.3.4
2 gems installed

And not the gem I requested! Crazyness...

probablykabari commented 13 years ago

This may or may not be related, but this didn't start happening until after I tried out gem_dependent. Everything works fine again after I did (gem sources -c) to clear out the cache.