I was having this problem in Windows XP machine. I am using Rails 2.0.2 and this is happening with ruby-debug 0.10.1.
When I do
require 'ruby-debug' in my development.rb of my rails application
and when I try to start the server
ruby script/server --debugger -e development -p 80
I get the following message and the server exits:
You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
When I try to do
require 'ruby-debug' from irb:
I get the following message:
LoadError: no such file to load -- c:/ruby/lib/ruby/gems/1.8/gems/linecache-0.42-x86-mswin32/lib/../ext/trace_nums
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from c:/ruby/lib/ruby/gems/1.8/gems/linecache-0.42-x86-mswin32/lib/tracelines.rb:8
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from c:/ruby/lib/ruby/gems/1.8/gems/linecache-0.42-x86-mswin32/lib/linecache.rb:63
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.1-x86-mswin32/lib/ruby-debug-base.rb:3
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from c:/ruby/lib/ruby/gems/1.8/gems/ruby-debug-0.10.1/cli/ruby-debug.rb:5
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
The fix that worked for me is the following:
In the file ruby\lib\ruby\gems\1.8\gems\linecache-0.42-x86-mswin32\lib\tracelines.rb
I changed the line from
require File.join(@@SRC_DIR, '..', 'ext', 'trace_nums')
to
require File.join(@@SRC_DIR, '..', 'ext', 'extconf.rb')
Then, the debugger started working as expected.