[rspec-users] Annoying problem, stack error

Kyle Hargraves philodespotos at gmail.com
Thu May 24 10:05:02 EDT 2007


I have periodically been having this problem with edge, and I've seen
others complaining about it happening before that, too. If you google
it, you'll see this error ("Expected .../...rb to define ...") is
fairly common.

In my case, the issue was that I hadn't run db:migrate recently, and
my has_many_polymorphs was somehow going a little crazy. "Expected
.../tag.rb to define Tag".

It's definitely not rspec, it's something that's not quite kosher on
your end. Unfortunately, the error is painfully uninformative.

Kyle

On 5/24/07, Fischer, Daniel <daniel at danielfischer.com> wrote:
> For some reason rake spec is totally crapping out on me.
>
> I don't know what I did to make it break, the only thing I tried new
> was install haml, but even after removing it there is still a stack
> trace.
>
> Here is what I am getting-
>
> sparta at phalanx ff $ rake spec
> (in /Users/sparta/Projects/work/idastudios/ff)
> ..................../usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:249:in
> `load_missing_constant': Expected
> /Users/sparta/Projects/work/idastudios/ff/config/../app/models/asset.rb
> to define Asset (LoadError)
>         from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:452:in
> `const_missing'
>         from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:464:in
> `const_missing'
>         from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:260:in
> `load_missing_constant'
>         from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:468:in
> `const_missing'
>         from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1360:in
> `compute_type'
>         from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/reflection.rb:125:in
> `send'
>         from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/reflection.rb:125:in
> `klass'
>         from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/associations/has_many_association.rb:194:in
> `construct_sql'
>          ... 30 levels...
>         from /Users/sparta/Projects/work/idastudios/ff/vendor/plugins/rspec/lib/spec/runner/option_parser.rb:154:in
> `parse'
>         from /Users/sparta/Projects/work/idastudios/ff/vendor/plugins/rspec/lib/spec/runner/option_parser.rb:88:in
> `create_behaviour_runner'
>         from /Users/sparta/Projects/work/idastudios/ff/vendor/plugins/rspec/lib/spec/runner/command_line.rb:14:in
> `run'
>         from /Users/sparta/Projects/work/idastudios/ff/vendor/plugins/rspec/bin/spec:3
> rake aborted!
> Command ruby -I"/Users/sparta/Projects/work/idastudios/ff/vendor/plugins/rspec/lib"
> "/Users/sparta/Projects/work/idastudios/ff/vendor/plugins/rspec/bin/spec"
> "spec/controllers/comments_controller_spec.rb"
> "spec/controllers/posts_controller_spec.rb"
> "spec/controllers/users_controller_spec.rb"
> "spec/models/asset_spec.rb" "spec/models/category_spec.rb"
> "spec/models/comment_spec.rb" "spec/models/message_spec.rb"
> "spec/models/post_spec.rb" "spec/models/user_spec.rb"
> "spec/models/vote_spec.rb" --options
> "/Users/sparta/Projects/work/idastudios/ff/config/../spec/spec.opts"
> failed
>
> (See full trace by running task with --trace)
>
> Anyone have an idea what the heck is going on?
>
> Thanks,
> Daniel
>
> --
> www.writersbeat.com
> www.danielfischer.com
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list