-
-
Save dnagir/1441091 to your computer and use it in GitHub Desktop.
> rvm use jruby | |
Using /Users/dnagir/.rvm/gems/jruby-1.6.5 | |
> bundle exec rspec spec/models/user_spec.rb --backtrace | |
NameError: uninitialized constant ActiveRecord | |
> rvm use 1.9.3 | |
Using /Users/dnagir/.rvm/gems/ruby-1.9.3-p0 | |
> bundle exec rspec spec/models/user_spec.rb --backtrace | |
/Users/dnagir/proj/abc/lib/extensions/has_address.rb:15:in `<top (required)>': uninitialized constant ActiveRecord (NameError) | |
from /Users/dnagir/proj/abc/config/initializers/extensions.rb:2:in `block in <top (required)>' | |
from /Users/dnagir/proj/abc/config/initializers/extensions.rb:1:in `each' | |
from /Users/dnagir/proj/abc/config/initializers/extensions.rb:1:in `<top (required)>' | |
from /Users/dnagir/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.3/lib/rails/engine.rb:556:in |
It won't help. It is not only spec-related. headius pointed out that it's an issue with JRuby http://jira.codehaus.org/browse/JRUBY-6252
Looks like it happens when process receives QUIT signal or similar. So it just doesn't have enough time to print the trace out (sounds strange, isn't It?).
Not sure why wouldn't it help. Rake prints a stack trace upon exception in any ruby machine. "Not enough time" sounds ridiculous indeed.
--trace
is similar to --backtrace
in RSpec. But in any case, it indeed doesn't help.
Interesting thing is that it only seems to happen in the Rails initializers.
The exact answer was I think it's just a problem printing out backtraces when we're running the ^C exit hook.
.
Whatever the problem is I hope it will be fixed soon.
BTW, if you're keen to try it (which I doubt :-) ), here is my repro: https://gist.github.com/1441257
Try running your specs with
rake
with the--trace
flag.