rails / rails-dev-box

A virtual machine for Ruby on Rails core development
MIT License
2.05k stars 580 forks source link

`bundle exec rake test` does not work in subdirectories #165

Closed jlw closed 5 years ago

jlw commented 5 years ago

Running the full test suite from /vagrant/rails works fine, but following the instructions in the Contributing to Ruby on Rails guide does not work.

vagrant@rails-dev-box:/vagrant/rails$ cd actioncable/
vagrant@rails-dev-box:/vagrant/rails/actioncable$ bundle exec rake test
Traceback (most recent call last):
    1: from /usr/local/bin/rake:23:in `<main>'
/usr/local/bin/rake:23:in `load': cannot load such file -- /usr/share/rubygems-integration/all/specifications/exe/rake (LoadError)
vagrant@rails-dev-box:/vagrant/rails/actioncable$ cd ../actionmailbox/
vagrant@rails-dev-box:/vagrant/rails/actionmailbox$ bundle exec rake test
Traceback (most recent call last):
    1: from /usr/local/bin/rake:23:in `<main>'
/usr/local/bin/rake:23:in `load': cannot load such file -- /usr/share/rubygems-integration/all/specifications/exe/rake (LoadError)
vagrant@rails-dev-box:/vagrant/rails/actionmailbox$ cd ../actionmailer/
vagrant@rails-dev-box:/vagrant/rails/actionmailer$ bundle exec rake test
Traceback (most recent call last):
    1: from /usr/local/bin/rake:23:in `<main>'
/usr/local/bin/rake:23:in `load': cannot load such file -- /usr/share/rubygems-integration/all/specifications/exe/rake (LoadError)
vagrant@rails-dev-box:/vagrant/rails/actionmailer$ cd ../actionpack/
vagrant@rails-dev-box:/vagrant/rails/actionpack$ bundle exec rake test
Traceback (most recent call last):
    1: from /usr/local/bin/rake:23:in `<main>'
/usr/local/bin/rake:23:in `load': cannot load such file -- /usr/share/rubygems-integration/all/specifications/exe/rake (LoadError)

... and so on.

Is anyone else seeing this, or do I have something "special" in my brand new setup?

jlw commented 5 years ago

Perhaps a similar cause, running an individual test file (per the same guide) also fails:

vagrant@rails-dev-box:/vagrant/rails$ bundle exec ruby -w -Itest railties/test/railties/engine_test.rb
Traceback (most recent call last):
    1: from railties/test/railties/engine_test.rb:3:in `<main>'
railties/test/railties/engine_test.rb:3:in `require': cannot load such file -- isolation/abstract_unit (LoadError)
jlw commented 5 years ago

Maybe this was triggered by running local Rails apps on port 3000 (not within Vagrant / VirtualBox) between the time that I ran the full test suite and tried smaller sets? I did vagrant destroy; vagrant up and now it is working as expected.

fxn commented 5 years ago

Thanks for operining the issue anyway.

The railties command needs to be run in the railties directory by the way.

cseelus commented 4 years ago

Same problem here, with a brand new rails dev box on macOS 10.15.5:

vagrant@rails-dev-box:/vagrant/rails$ bundle exec ruby -w -Itest railties/test/application/system_test_case_test.rb
railties/test/application/system_test_case_test.rb:51: warning: assigned but unused variable - system_test
Traceback (most recent call last):
    1: from railties/test/application/system_test_case_test.rb:3:in `<main>'
railties/test/application/system_test_case_test.rb:3:in `require': cannot load such file -- isolation/abstract_unit (LoadError)
fxn commented 4 years ago

The railties command needs to be run in the railties directory by the way.