I installed some new gems for testing and ran into an uninitialized constant ActionController::Dispatcher::MiddlewareStack error. I followed the instructions on the gem rdocs-specified the gem dependency in my environment.rb file and then ran rake gems:install and rake gems:unpack.
I also copied over my environment.rb file one line at a time into a different project and I did not get the error. I was wondering what other things could be going wrong.
Here is a longer version of the error (I first ran into the error running a simple test; same thing happens in a console when I do require 'active_support'):
$ ruby test/unit/user_test.rb
** has_many_polymorphs: rails environment detected
/Users/thaiyoshi/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:105:in `const_missing': uninitialized constant ActionController::Dispatcher::MiddlewareStack (NameError)
from /Users/thaiyoshi/.gem/ruby/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:71
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /Users/thaiyoshi/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
from /Users/thaiyoshi/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
from /Users/thaiyoshi/.gem/ruby/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
from /Users/thaiyoshi/.gem/ruby/1.8/gems/has_many_polymorphs-2.13/lib/has_many_polymorphs/autoload.rb:2
from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
... 8 levels...
from ./test/unit/../test_helper.rb:2:in `require'
from ./test/unit/../test_helper.rb:2
from test/unit/user_test.rb:1:in `require'
from test/unit/user_test.rb:1
Here's my environment.rb file (default comments removed):
RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
# config.gem 'has_many_polymorphs', :version => "2.12"
# require ‘has_many_polymorphs‘
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
require 'has_many_polymorphs'
require 'active_support'
Rails::Initializer.run do |config|
config.time_zone = 'UTC'
config.gem "thoughtbot-factory_girl",
:lib => "factory_girl",
:source => "http://gems.github.com"
config.gem 'thoughtbot-shoulda',
:lib => false,
:source => 'http://gems.github.com'
end