Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialjooyoonbyun
3,438 Pointsbin/rspec spec/models/user_spec.rb doesn't work
When I type bin/rspec spec/models/user_spec.rb,
Terminal prints this kind of error. What is the problem?
treehouse:~/projects/odot (master *) $ bin/rspec spec/models/user_spec.rb
/home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:461:in load_missing_constant': Circular dependency detected while autoloading constant UsersHelper (RuntimeError)
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:184:in
const_missing'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/inflector/methods.rb:226:in const_get'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/inflector/methods.rb:226:in
block in constantize'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/inflector/methods.rb:224:in each'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/inflector/methods.rb:224:in
inject'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/inflector/methods.rb:224:in constantize'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/core_ext/string/inflections.rb:66:in
constantize'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.0.1/lib/abstract_controller/helpers.rb:139:in block in modules_for_helpers'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.0.1/lib/abstract_controller/helpers.rb:130:in
map!'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.0.1/lib/abstract_controller/helpers.rb:130:in modules_for_helpers'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.0.1/lib/action_controller/metal/helpers.rb:89:in
modules_for_helpers'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.0.1/lib/abstract_controller/helpers.rb:94:in helper'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.0.1/lib/action_controller/railties/helpers.rb:17:in
inherited'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.0.1/lib/action_view/test_case.rb:9:in <class:TestCase>'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.0.1/lib/action_view/test_case.rb:8:in
<module:ActionView>'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/actionpack-4.0.1/lib/action_view/test_case.rb:6:in <top (required)>'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-rails-2.99.0/lib/rspec/rails/example/helper_example_group.rb:7:in
<module:HelperExampleGroup>'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-rails-2.99.0/lib/rspec/rails/example/helper_example_group.rb:4:in <module:Rails>'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-rails-2.99.0/lib/rspec/rails/example/helper_example_group.rb:3:in
<top (required)>'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in require'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in
block in require'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in load_dependency'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in
require'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-rails-2.99.0/lib/rspec/rails/example.rb:4:in <top (required)>'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in
require'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in block in require'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in
load_dependency'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in require'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-rails-2.99.0/lib/rspec/rails.rb:19:in
<top (required)>'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in require'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in
block in require'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in load_dependency'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in
require'
from /home/treehouse/projects/odot/spec/spec_helper.rb:4:in <top (required)>'
from /home/treehouse/projects/odot/spec/models/user_spec.rb:1:in
require'
from /home/treehouse/projects/odot/spec/models/user_spec.rb:1:in <top (required)>'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in
load'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in block in load_spec_files'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in
each'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in load_spec_files'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:18:in
run'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:103:in run'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:17:in
block in autorun'
1 Answer
Steve Hunter
57,712 PointsHi there,
That error doesn't help much. Can you post the test file and the helper file code, please? So, user_spec.rb
and spec_helper.rb
. There's some issue with the require
statements, I think.
Steve.