I'm getting uninitialized constant Test
when running rails console
in terminal. I'm not sure why I just set it up and using the command rails server
works.
This is the error I get:
/usr/lib/ruby/vendor_ruby/active_support/test_case.rb:12:in `<module:ActiveSupport>': uninitialized constant Test (NameError)
I ran into this same problem on my Ubuntu 14.04 desktop. Solved in the following way:
sudo apt-get install ruby-test-unit
echo require 'test/unit' >> /usr/lib/ruby/vendor_ruby/active_support/test_case.rb
see this link: https://bugs.launchpad.net/ubuntu/+source/ruby-activesupport-3.2/+bug/1319101
I had this issue when copied and pasted the config from shoulda-matchers getting started guide. But I wasn't removing the unused tests frameworks.
To use with RSpec it will be as:
Shoulda::Matchers.configure do |config|
config.integrate do |with|
# Choose a test framework:
with.test_framework :rspec
# with.test_framework :minitest
# with.test_framework :minitest_4
# with.test_framework :test_unit
# Choose one or more libraries:
with.library :active_record
with.library :active_model
with.library :action_controller
# Or, choose the following (which implies all of the above):
with.library :rails
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With