Rails undefined method 'use _ transactional_fixtures ='

Source: Internet
Author: User

I recently created a new rails project and tried test driven development. So I wrote a few tests, the following error is reported when rake is used to call the test or directly execute the ruby test program.

Undefined method 'use _ transactional_fixtures ='

It's really amazing. I tried to check MySQL and check that there is no problem with the checklist type (InnoDB). I further checked that my testcase was not actually injected with rails extensions, all of them have become the most common testcase. It's really depressing! When Google checked for half a day at night, the problem was not solved.

After consulting Cookoo on the next day, I tested it again and found that this problem was not found in the newly created rails project. So I suspected there was a problem with the installed plug-in and deleted all the plug-ins, the problem persists... (omitted in the middle )... I finally found that it was caused by the zentest gem package and tried to remove the file zentest/test/test_help.rb. The problem was solved.

Next, I analyzed the cause and found that my project uses cached_model. cached_model will introduce zentest, test_help.rb in zentest, and test_help.rb in rails, because cached_model will load first, therefore, zentest overwrites the later test_help, which directly causes the rails environment to fail to load.

Zentest (test_help.rb) rails (test_help.rb) cannot coexist, so it is better to remove the former.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.