dchelimsky / rspec-rails

RSpec extension library for Ruby on Rails

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot load such file -- spec/rails/example/helper_example_group_helper (LoadError)

toddboom opened this issue · comments

This happens with Ruby 1.9.3-p194 and Rails 2.3.14. Dropping down to Ruby 1.9.2-p290 resolves the issue.

Here's the backtrace (with unnecessarily long paths redacted):

/.../activesupport-2.3.14/lib/active_support/dependencies.rb:184:in 'require': cannot load such file -- spec/rails/example/helper_example_group_helper (LoadError)
from /.../activesupport-2.3.14/lib/active_support/dependencies.rb:184:in 'require'
from /.../activesupport-2.3.14/lib/active_support/dependencies.rb:291:in 'require_or_load'
from /.../activesupport-2.3.14/lib/active_support/dependencies.rb:250:in 'depend_on'
from /.../activesupport-2.3.14/lib/active_support/dependencies.rb:162:in 'require_dependency'
from /.../actionpack-2.3.14/lib/action_controller/helpers.rb:197:in 'default_helper_module!'
from /.../actionpack-2.3.14/lib/action_controller/helpers.rb:212:in 'inherited_with_helper'
from /.../rspec-rails-1.3.4/lib/spec/rails/example/helper_example_group.rb:4:in '<module:Example>'
from /.../rspec-rails-1.3.4/lib/spec/rails/example/helper_example_group.rb:3:in '<module:Rails>'
from /.../rspec-rails-1.3.4/lib/spec/rails/example/helper_example_group.rb:2:in '<module:Spec>'
from /.../rspec-rails-1.3.4/lib/spec/rails/example/helper_example_group.rb:1:in '<top (required)>'
from /.../activesupport-2.3.14/lib/active_support/dependencies.rb:184:in 'require'
from /.../activesupport-2.3.14/lib/active_support/dependencies.rb:184:in 'require'
from /.../rspec-rails-1.3.4/lib/spec/rails/example.rb:9:in '<top (required)>'
from /.../activesupport-2.3.14/lib/active_support/dependencies.rb:184:in 'require'
from /.../activesupport-2.3.14/lib/active_support/dependencies.rb:184:in 'require'
from /.../rspec-rails-1.3.4/lib/spec/rails.rb:17:in '<top (required)>'
from /.../activesupport-2.3.14/lib/active_support/dependencies.rb:184:in 'require'
from /.../activesupport-2.3.14/lib/active_support/dependencies.rb:184:in 'require'
from spec/spec_helper.rb:36:in '<top (required)>'
from spec/controllers/widgets_controller_spec.rb:1:in 'require'
from spec/controllers/widgets_controller_spec.rb:1:in '<top (required)>'
from /.../rspec-1.3.2/lib/spec/runner/example_group_runner.rb:15:in 'load'
from /.../rspec-1.3.2/lib/spec/runner/example_group_runner.rb:15:in 'block in load_files'
from /.../rspec-1.3.2/lib/spec/runner/example_group_runner.rb:14:in 'each'
from /.../rspec-1.3.2/lib/spec/runner/example_group_runner.rb:14:in 'load_files'
from /.../rspec-1.3.2/lib/spec/runner/options.rb:134:in 'run_examples'
from /.../rspec-1.3.2/lib/spec/runner/command_line.rb:9:in 'run'
from /.../rspec-1.3.2/bin/spec:5:in '<main>'

This issue isn't specific to RSpec, it's a general problem with Rails 2.3.x and Ruby 1.9.3. You can find a discussion here:

https://groups.google.com/forum/#!msg/rubyonrails-core/gb5woRkmDlk/iQ2G7jjNWKkJ

The quick fix is just to add the following line to an initializer:

MissingSourceFile::REGEXPS << [/^cannot load such file -- (.+)$/i, 1]