debug icon indicating copy to clipboard operation
debug copied to clipboard

Having to specify bundle exec twice

Open petertimwalker opened this issue 1 year ago • 3 comments

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!

petertimwalker avatar May 15 '24 20:05 petertimwalker

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

Is debug part of your Gemfile?

adam12 avatar May 15 '24 20:05 adam12

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

petertimwalker avatar May 16 '24 13:05 petertimwalker

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?

ko1 avatar Dec 17 '24 20:12 ko1