#12 ✓resolved
Luismi Cavallé

Error requiring files on Ubuntu

Reported by Luismi Cavallé | July 4th, 2008 @ 10:04 AM

We're using the edge version of webrat and getting this error in our test environment (Ubuntu 8.04):

/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:478:in `const_missing': uninitialized constant Webrat::Page::Logging (NameError)
    from /home/deploy/.cruise/projects/nimble/work/vendor/plugins/webrat/lib/webrat/core/page.rb:7
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:in `require'
    from /home/deploy/.cruise/projects/nimble/work/vendor/plugins/webrat/lib/webrat/core.rb:2
    from /home/deploy/.cruise/projects/nimble/work/vendor/plugins/webrat/lib/webrat/core.rb:1:in `each'
     ... 32 levels...
    from /home/deploy/.cruise/projects/nimble/work/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb:13:in `load_files'
    from /home/deploy/.cruise/projects/nimble/work/vendor/plugins/rspec/lib/spec/runner/options.rb:85:in `run_examples'
...

It seems the problem is in how files are required in core.rb. logger.rb must be required before page.rb. For some reason in our test environment the order returned by Dir[] is not ok.

You'll find attached a tiny patch that solves the problem (applicable using git am < patch.diff)

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Ruby Acceptance Testing for Web applications.

Shared Ticket Bins

People watching this ticket

Attachments

Tags

Pages