Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having to specify bundle exec twice #1102

Open
petertimwalker opened this issue May 15, 2024 · 3 comments
Open

Having to specify bundle exec twice #1102

petertimwalker opened this issue May 15, 2024 · 3 comments

Comments

@petertimwalker
Copy link

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!

@adam12
Copy link
Contributor

adam12 commented May 15, 2024

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

Is debug part of your Gemfile?

@petertimwalker
Copy link
Author

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

@ko1
Copy link
Collaborator

ko1 commented Dec 17, 2024

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
Labels
None yet
Development

No branches or pull requests

3 participants