When I issue
$ rake spec
or
$ bundle exec rake spec
I get
uninitialized constant Web::BaseHelper::AuthenticationMethods (NameError)
because of
module Web::BaseHelper
include AuthenticationMethods
...
end
where AuthenticationMethods is defined in
config/initializers/authentication_methods.rb. If I change
web/base_helper.rb to
require "#{Rails.root}/config/initializers/authentication_methods"
unless defined? AuthenticationMethods
module Web::BaseHelper
include AuthenticationMethods
...
end
the error is no longer reported.
I added Bundler by following the instructions on the Bundler and Rails
2.3 page [1].
I have searched via Google quite a lot 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 have upgraded to Bundler 1.0.0.rc.6 and still have the problem.
I read Rick DeNatale's post [2] regarding Bundler, rspec, and rake, and
while I haven't made the changes he describes, I did try forcing the
environment with
$ rake spec RAILS_ENV=test
and encountered 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 available.
Can anyone offer insight, words of wisdom, encouragement, or a solution?
Thanks,
Phillip
[1] http://gembundler.com/rails23.html
[2]
http://talklikeaduck.denhaven2.com/2010/06/25/making-rspec-rake-and-bundler-play-well-together
> --
> You received this message because you are subscribed to the Google Groups "ruby-bundler" group.
> To post to this group, send email to ruby-b...@googlegroups.com.
> To unsubscribe from this group, send email to ruby-bundler...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ruby-bundler?hl=en.
>
Thanks for the suggestion, Donovan. My Gemfile looks like this:
source 'http://gemcutter.org'
# bundler requires these gems in all environments
gem 'rails', '2.3.8'
gem 'pg', '0.9.0'
gem 'crack', '0.1.7'
gem 'httparty', '0.6.0'
gem 'libxml-ruby', '1.1.4'
gem 'happymapper', '0.3.1'
gem 'haml', '3.0.12'
gem 'pdf-reader', '0.8.5', :require => 'pdf/reader'
gem 'Ascii85', '1.0.0', :require => 'ascii85'
group :production do
gem 'exceptional', '2.0.25'
end
group :development, :test do
gem 'rspec', '1.3.0'
gem 'rspec-rails', '1.3.2'
gem 'remarkable_rails', '3.1.13'
gem 'database_cleaner', '0.5.2'
gem 'wirble', '0.1.3'
gem 'ruby-debug', '0.10.3'
gem 'mongrel', '1.1.5'
end
and I still have the problem.
Peace,
Phillip