Question

I am trying to get autotest working with my rails project but I keep on getting different errors.

My setup:

  • Windows 7 OS
  • My rails version is 3.1.3
  • My ruby version is 1.9.2p290
  • My ZenTest gem is at 4.5 (but also tried 4.6.2)
  • My minitest gem is at 1.6.0 (but also tried 2.10.0)

First off what gems should I be installing?

I ran into a bunch of different autotest gems and try a bunch of different combos but nothing seems to be working.

ive tried

  • gem install autotest-rails (seemed the most likely)

but also

  • gem install autotest
  • gem install autotest-standalone
  • gem install autotest-rails-pure

(sources)

I got a couple different failures but the most common one i got was the following

c:\RailsInstaller\Ruby1.9.2\bin\ruby -I.;lib;test -rubygems -e "['test/unit', 'test/functional/status_controller_test.rb
', 'test/unit/helpers/status_helper_test.rb', 'test/unit/helpers/home_helper_test.rb', 'test/unit/user_test.rb', 'test/f
unctional/home_controller_test.rb', 'test/functional/playlists_controller_test.rb', 'test/unit/playlist_test.rb', 'test/
functional/registrations_controller_test.rb', 'test/unit/song_test.rb', 'test/unit/helpers/about_helper_test.rb', 'test/
unit/helpers/playlists_helper_test.rb', 'test/functional/songs_controller_test.rb', 'test/unit/helpers/registrations_hel
per_test.rb', 'test/unit/helpers/songs_helper_test.rb', 'test/functional/about_controller_test.rb'].each { |f| require f
}" | ruby c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/autotest-standalone-4.5.9/bin/unit_diff -u

c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/turn-0.8.3/lib/turn/autorun/minitest.rb:14:in `<top (required)>': MiniTest v1.6.0 is     out of date. (RuntimeError)
`gem install minitest` and add `gem 'minitest' to you test helper.

    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:225:in `load_dependency'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/turn-0.8.3/lib/turn.rb:13:in `<top (required)>'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:225:in `load_dependency'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/test_help.rb:19:in `<top (required)>'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:225:in `load_dependency'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
    from c:/RailsProjects/songrake/test/test_helper.rb:3:in `<top (required)>'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from c:/RailsProjects/songrake/test/functional/status_controller_test.rb:1:in `<top (required)>'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from c:/RailsInstaller/Ruby1.9.2/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from -e:1:in `block in <main>'
    from -e:1:in `each'
    from -e:1:in `<main>'

I also tried adding variations of gem "minitest" (with different version number) to my gemfile. I also tried adding some of the other gem files to the gemfile.

Anyways would love to use this tool! Thanks for the help!

Était-ce utile?

La solution

Thanks to this question, I was able to figure it out...

Error running autotest on Windows 7 with Rails 3, Ruby 1.9.2

All you need is the ZenTest gem and the autotest-test-pure gem.

Then add the following to your gemfile:

group :test do
  gem 'ZenTest'
  gem 'autotest-rails-pure'
  gem 'minitest'
end

and instead of just running "$ autotest" from the command line you need to run "$ bundle exec autotest"


I didn't understand what bundle exec did but heres an explination I found on http://gembundler.com/

Bundle exec

Run an executable that comes with a gem in your bundle

$ bundle exec rspec spec/models

In some cases, running executables without bundle exec may work, if the executable happens to be installed in your system and does not pull in any gems that conflict with your bundle.

However, this is unreliable and is the source of considerable pain. Even if it looks like it works, it may not work in the future or on another machine.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top