Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6893615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:40:51+00:00 2026-05-27T06:40:51+00:00

I trying to get a backtrace with rspec but I can’t get it working

  • 0

I trying to get a backtrace with rspec but I can’t get it working for some reason.

This is the test file:

require 'spec_helper'

describe ActivityReport do
  it "should create a new instance given valid attributes" do
  activity = Factory(:activity_report)
end

This is the command I run:

rspec --backtrace spec/models/activity_report_spec.rb

And this is what I get:

No examples matched {:focus=>true}. Running all.

ActivityReport
  should create a new instance given valid attributes (FAILED - 1)

Failures:

  1) ActivityReport should create a new instance given valid attributes
     Failure/Error: Unable to find matching line from backtrace
     SystemStackError:
       stack level too deep
     # /Users/pbartels/.rvm/gems/ruby-1.9.2-p290@brothelking/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:206

Finished in 40.76 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/models/activity_report_spec.rb:16 # ActivityReport should create a new instance given valid attributes

My .rspec:

--format nested
--color
--drb
--backtrace

And my RSpec part in spec_helper.rb:

ENV["RAILS_ENV"] ||= 'test'

require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'factory_girl'
require 'database_cleaner'
require 'active_record/fixtures'

DatabaseCleaner.strategy = :truncation
DatabaseCleaner.start

Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}

RSpec.configure do |config|
  config.mock_with :rspec

  config.use_transactional_fixtures = true

  config.treat_symbols_as_metadata_keys_with_true_values = true  
  config.filter_run :focus => true  
  config.run_all_when_everything_filtered = true

  config.backtrace_clean_patterns = [
    /\/lib\d*\/ruby\//,
    /bin\//,
    #/gems/,
    /spec\/spec_helper\.rb/,
    /lib\/rspec\/(core|expectations|matchers|mocks)/
  ]
end

I tried it with and without “backtrace_clean_patterns”.

Anyone knows what’s wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:40:52+00:00Added an answer on May 27, 2026 at 6:40 am

    There’s no backtrace because it isn’t a given line of code that’s failing, it’s actually the structure of your code. The ruby interpreter is literally running out of room to store further method calls on the stack.

    Stack level too deep typically means that you’ve got recently added/modified code that is calling itself, and going into a infinitely recursive black hole. Look at the code that you’ve recently added (including tests) for the clue. See if you’re calling a method from within itself.

    For example, this code will cause stack overflow:

    def recursive_method
      recursive_method
    end
    

    You’ve probably got a method call or field that shares the name of a method, and when you reference it, it’s going into this infinite loop/recursive call.

    If that doesn’t point you in the right direction, you may be forced to incrementally revert you recent code changes until the problem goes away. When you get back to a state in your code where the problem goes away, you’ll know that the issue has something to do with that change, though the specifics may not be immediately clear.

    The other option, if you’re really not getting anywhere with that (or it’s not feasible to revert changes in an intelligent way), is to start adding debug lines to your code where you suspect the problem might be. Somehow you’ll need to get your app to write to a log file or something so you can figure out what it is that it’s doing right before it dies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to get this example working from http://www.munna.shatkotha.com/blog/post/2008/10/26/Light-box-effect-with-WPF.aspx However, I can't seem to get
Hello everyone I been trying get php uploader working but having a lot of
I'm trying to get a backtrace from a core file generated by PHP. I'm
I am trying to get Rspec up and running but ran into the following
I am trying get all local machine services. But why are some services missing
Trying to get my css / C# functions to look like this: body {
Trying to get an ASP application deployed; it worked for a while but then
Trying to get comfortable with jQuery and I have encountered some sample code that
Trying to get this to work, with no luck: [DataMember] public Type ParameterType {
Trying to get my mind around google protobuf. I found some implementation of protobuf

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.