views:

142

answers:

1

I have a rails project that runs fine in development and production and the tests pass when I do a rake test but when I try to autotest it it fails with:

Missing the Rails 2.3.3 gem. Please `gem install -v=2.3.3 rails`, blah blah

Of course the rails gem is not missing and if I comment this line out, it complains about the rest of the gems.


Trying to debug the problem, I initiated a new rails project and started copying code from the problematic one and running autotest every now and then. After a couple of minutes I had copied all the files (even the tmp folder) and autotest was not complaining at all.

The only difference between the projects is their RAILS_ROOT, one is ~/Sites/market and the other ~/Code/tempora and their .git folders though I seriously doubt it should make much of a difference.

Also I have a ~/.autotest with the following inside (which should also make no difference):

require 'autotest/growl'
require 'autotest/timestamp'

I really have no idea on where to look for debugging this anymore....

LOCAL GEMS

  • rails (2.3.3, 2.3.2, 2.2.2, 2.1.1, 2.1.0)
  • ZenTest (4.1.3, 4.1.1) - also tried with 4.1.4 yielding the same results
  • autotest-fsevent (0.1.1)
  • autotest-growl (0.1.6, 0.1.2)
  • autotest-rails (4.1.0)
A: 

The only thing I can think of is that autotest is looking for Rails in your ~/.gem folder in one instance and in your /Library/Ruby/Gems in another. What might sort it out is just to install RVM. Then, create an RVM environment with just the gems you need and try running in that. Learn more about RVM here: http://rvm.beginrescueend.com/

John Glass