Skip to content

Instantly share code, notes, and snippets.

@dcorking
Created August 5, 2013 13:36
Show Gist options
  • Save dcorking/6155961 to your computer and use it in GitHub Desktop.
Save dcorking/6155961 to your computer and use it in GitHub Desktop.
Minitest not working in Rails 3.2.14. Is this line misconfigured? require File.expand_path('../../config/environment', __FILE__)
david2@www:~/daves-dream-blog$ bundle exec rake db:test:load
david2@www:~/daves-dream-blog$ bundle exec ruby -Itest test/functional/dreams_controller_test.rb
/home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.14/lib/active_record/dynamic_matchers.rb:55:in `method_missing': undefined method `state_machine' for Subscription(Table doesn't exist):Class (NoMethodError)
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/saas-0.1.1/app/models/subscription.rb:20:in `<class:Subscription>'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/saas-0.1.1/app/models/subscription.rb:1:in `<top (required)>'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `block in require'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:359:in `require_or_load'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:502:in `load_missing_constant'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:192:in `block in const_missing'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:190:in `each'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:190:in `const_missing'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/inflector/methods.rb:230:in `block in constantize'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/inflector/methods.rb:229:in `each'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/inflector/methods.rb:229:in `constantize'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/inflector/methods.rb:260:in `safe_constantize'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/core_ext/string/inflections.rb:66:in `safe_constantize'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.2.14/lib/action_controller/metal/params_wrapper.rb:152:in `_default_wrap_model'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.2.14/lib/action_controller/metal/params_wrapper.rb:169:in `_set_wrapper_defaults'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.2.14/lib/action_controller/metal/params_wrapper.rb:133:in `inherited'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.2.14/lib/abstract_controller/railties/routes_helpers.rb:7:in `block (2 levels) in with'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/actionpack-3.2.14/lib/action_controller/railties/paths.rb:7:in `block (2 levels) in with'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/saas-0.1.1/app/controllers/subscriptions_controller.rb:1:in `<top (required)>'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `block in require'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:359:in `require_or_load'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:313:in `depend_on'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:225:in `require_dependency'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.14/lib/rails/engine.rb:444:in `block (2 levels) in eager_load!'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.14/lib/rails/engine.rb:443:in `each'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.14/lib/rails/engine.rb:443:in `block in eager_load!'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.14/lib/rails/engine.rb:441:in `each'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.14/lib/rails/engine.rb:441:in `eager_load!'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.14/lib/rails/application/railties.rb:8:in `each'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.14/lib/rails/application/railties.rb:8:in `all'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.14/lib/rails/engine.rb:439:in `eager_load!'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.14/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.14/lib/rails/initializable.rb:30:in `instance_exec'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.14/lib/rails/initializable.rb:30:in `run'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.14/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.14/lib/rails/initializable.rb:54:in `each'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.14/lib/rails/initializable.rb:54:in `run_initializers'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.14/lib/rails/application.rb:136:in `initialize!'
from /home/david2/.rvm/gems/ruby-1.9.3-p448/gems/railties-3.2.14/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/david2/daves-dream-blog/config/environment.rb:5:in `<top (required)>'
from /home/david2/daves-dream-blog/test/test_helper.rb:2:in `require'
from /home/david2/daves-dream-blog/test/test_helper.rb:2:in `<top (required)>'
from test/functional/dreams_controller_test.rb:1:in `require'
from test/functional/dreams_controller_test.rb:1:in `<main>'
david2@www:~/daves-dream-blog$
david2@www:~/daves-dream-blog$ grep 'minitest' Gemfile
gem 'minitest', '4.3.3'
david2@www:~/daves-dream-blog$ cat test/test_helper.rb | head -n 5
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
gem "minitest"
require "minitest/autorun"
david2@www:~/daves-dream-blog$ cat config/environment.rb
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Dreamblog::Application.initialize!
@dcorking
Copy link
Author

dcorking commented Aug 6, 2013

I fixed this problem by removing require 'saas' from the Gemfile. I don't know why I added it in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment