Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #11601 (new defect)

Opened 1 month ago

Last modified 3 weeks ago

Ruby-debug Setup Problem: LoadError: no such file to load

Reported by: cagdas.gerede Assigned to: core
Priority: normal Milestone: 2.x
Component: Plugins Version: edge
Severity: normal Keywords: ruby-debug
Cc:

Description

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.

Change History

(in reply to: ↑ description ) 04/26/08 01:04:25 changed by BMorearty

I get the same error when using Rails 2.0.2 and ruby-debug 0.10.1 on Windows XP. I got the error when I ran script/server with no parameters.

Replying to cagdas.gerede:

LoadError: no such file to load -- c:/ruby/lib/ruby/gems/1.8/gems/linecache-0.42-x86-mswin32/lib/../ext/trace_nums