Uninitialized constant Validation at start of the Rails console

I get uninitialized constant Teston startup rails consolein the terminal. I'm not sure why I just installed it, and using the command rails serverworks.

This is the error I get:

/usr/lib/ruby/vendor_ruby/active_support/test_case.rb:12:in `<module:ActiveSupport>': uninitialized constant Test (NameError)
+4
source share
4 answers

I ran into this problem on my Ubuntu 14.04 desktop. It is solved as follows:

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

+3
source

. .

RSpec :

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
+1

echo Ubuntu 14.04. sudo vi test_case.rb "/" .

0

-: rvm rbenv? !

Secondly: it does not find a reference to a class named Test. Are you sure this name is? You demanded it right? What test structure are you using?

0
source

Source: https://habr.com/ru/post/1543107/


All Articles