I am trying to use Bundler on a Rails 2.3.8 project and am having a
problem when trying to run my specs. This application was on 2.3.5 until
yesterday, and I switched it to 2.3.8 and all specs passed. But after
adding Bundler (0.9.26), rake spec fails because (it appears) files in
config/initializers aren’t being loaded. Yet the application works when
When I issue
$ rake spec
uninitialized constant Web::BaseHelper::AuthenticationMethods
where AuthenticationMethods is defined in
config/initializers/authentication_methods.rb. If I change
unless defined? AuthenticationMethods
the error is no longer reported.
I added Bundler by following the instructions at the Bundler page.
I have also tried $ bundle exec rake spec, with the same result.
I have been searching Google all morning without finding a resolution.
I am using rspec 1.3.0 / rspec-rails 1.3.2, even before adding Bundler.
This is on Mac OS X 10.6.4 and ruby 1.8.7-p174 (Snow Leopard stock).
I read Rick DeNatale’s post regarding Bundler, rspec, and rake, and
while I haven’t made the changes he describes, I did try forcing the
$ rake spec RAILS_ENV=test
with the same result. I didn’t incorporate Rick’s changes yet because I
wanted to check here first to see if there is any other information
Can anyone offer insight, words of wisdom, encouragement, or a solution?
If this isn’t a problem specific to rspec, I apologize. I was trying to
think of some way to test something else, but the few things that came
to mind succeeded (well, didn’t generate any errors anyway).