Skip to content

Having to specify bundle exec twice #1102

Open

Description

@petertimwalker

I'm trying to run

rdbg -c -- bundle exec rspec <Path to rspec file>

but I keep getting this error
bundler: failed to load command: rspec
Prepending bundle exec to your command may solve this. (Gem::LoadError)
Screenshot 2024-05-15 at 3 56 53 PM

The weird thing is that when I enter the following command it works

rdbg -c -- bundle exec bundle exec rspec <Path to rspec file>

Any insight is appreciated!

Activity

  1. adam12 commented on May 15, 2024

    @adam12
    Contributor

    Does bundle exec rspec ... on it's own work, outside of rdbg?

    Is debug part of your Gemfile?

  2. petertimwalker commented on May 16, 2024

    @petertimwalker
    Author

    bundle exec rspec works outside of rdbg
    I installed debug as a system gem so its not in the projects gemfile

  3. ko1 commented on Dec 17, 2024

    @ko1
    Collaborator

    I make

    # Gemfile
    source "https://rubygems.org"
    
    gem 'rspec'
    gem 'debug'
    
    # spec/foo_spec.rb
    RSpec.describe 'foo' do
      it 'foo' do
        expect(1+1).to eq 2
      end
    end

    and run

    $ bundle install
    Bundle complete! 2 Gemfile dependencies, 15 gems now installed.
    Use `bundle info [gemname]` to see where a bundled gem is installed.
    
    $ bundle exec rspec
    .
    
    Finished in 0.00107 seconds (files took 0.03907 seconds to load)
    1 example, 0 failures
    
    
    $ rdbg -c bundle exec rspec
    WARN: Unresolved or ambiguous specs during Gem::Specification.reset:
          rdoc (>= 4.0.0)
          Available/installed versions of this gem:
          - 6.9.1
          - 6.6.3.1
    WARN: Clearing out unresolved specs. Try 'gem cleanup <gem>'
    Please report a bug if this causes problems.
    [4, 13] in ~/.rbenv/versions/3.3.1/bin/rspec
         4| #
         5| # The application 'rspec-core' is installed as part of a gem, and
         6| # this file is here to facilitate running it.
         7| #
         8|
    =>   9| require 'rubygems'
        10|
        11| Gem.use_gemdeps
        12|
        13| version = ">= 0.a"
    =>#0    <top (required)> at ~/.rbenv/versions/3.3.1/bin/rspec:9
      #1    [C] Kernel.load at ~/.rbenv/versions/3.3.1/lib/ruby/3.3.0/bundler/cli/exec.rb:58
      # and 14 frames (use `bt' command for all frames)
    (rdbg) c    # continue command
    .
    
    Finished in 0.00171 seconds (files took 0.05692 seconds to load)
    1 example, 0 failures
    

    but I can't repro. Any other steps?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions