Skip to content

Commit

Permalink
fix potentially misleading message when ruby-debug fails to load
Browse files Browse the repository at this point in the history
- it was saying install 'ruby-debug' even if the problem was an upstream
  dependency
- now it uses the message from the LoadError to define the missing gem
  • Loading branch information
dchelimsky committed Jun 21, 2011
1 parent e177f16 commit 975944c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/rspec/core/configuration.rb
Expand Up @@ -253,15 +253,17 @@ def debug=(bool)
begin
require 'ruby-debug'
Debugger.start
rescue LoadError
rescue LoadError => e
raise <<-EOM
#{'*'*50}
You must install ruby-debug to run rspec with the --debug option.
#{e.message}
If you have ruby-debug installed as a ruby gem, then you need to either
require 'rubygems' or configure the RUBYOPT environment variable with
the value 'rubygems'.
If you have it installed as a ruby gem, then you need to either require
'rubygems' or configure the RUBYOPT environment variable with the value
'rubygems'.
#{e.backtrace.join("\n")}
#{'*'*50}
EOM
end
Expand Down

0 comments on commit 975944c

Please sign in to comment.