Cannot load such file -- spec_helper

Not sure what’s gone wrong here (apart from the obvious missing spec_helper).

I’ve just cloned the Discourse repo and followed these steps for mac. I’m used to setting up projects and familiar with the steps involved.

I noticed rails_helper doesn’t require spec_helper and there is no spec_helper in the project. How are you guys running your rspec tests?

I get this error whether I run bundle exec rspec or bundle exec rake autospec.

Any help would be greatly appreciated as I’d rather not have to run in a VM.

1 Like

Can you paste the exact version of the error?

What does ruby --version return? Are you in the discourse directory when you are running this? (and not in a subdirectory like spec)

4 Likes

I’ve fixed this issue, it was nothing to do with Discourse per se.

I had --require spec_helper in my .rspec file which is recommended in multiple places, even the rspec github wiki!

I removed that line and now the tests run. Wanted to reply here in case anyone else runs into this issue.

7 Likes

This topic was automatically closed after 26 hours. New replies are no longer allowed.