Can you run rdebug on specs? I get errors when I try: $ rdebug spec ./spec/models/select_option_spec.rb ./spec: Is a directory - ./spec (Errno::EISDIR) from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ rdebug:136:in `debug_load'' from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ rdebug:136 from /opt/local/bin/rdebug:16:in `load'' from /opt/local/bin/rdebug:16
On 6/12/07, Jonathan Linowes <jonathan at parkerhill.com> wrote:> Can you run rdebug on specs? > > I get errors when I try: > > $ rdebug spec ./spec/models/select_option_spec.rb > ./spec: Is a directory - ./spec (Errno::EISDIR) > from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ > rdebug:136:in `debug_load'' > from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ > rdebug:136 > from /opt/local/bin/rdebug:16:in `load'' > from /opt/local/bin/rdebug:16 >Try the following: require ''ruby-debug'' at top of your spec file. then, put ''debugger'' inside your example block. That worked for me, also in combination with spec -e (just to run a specific example to pinpoint the problem). HTH, -- Luis Lavena Multimedia systems - Leaders are made, they are not born. They are made by hard effort, which is the price which all of us must pay to achieve any goal that is worthwhile. Vince Lombardi
Since this appears to be for Rails, get ruby-debug instead. Then you just have to put ''debugger'' in where you want to enter your code. It works great. Otherwise, it may still work, but it will probably require configuration. The other option is to see what rdebug''s version of the -I switch is. For ruby (command line) -I followed by the library path makes that library get loaded. -----Original Message----- From: rspec-users-bounces at rubyforge.org [mailto:rspec-users-bounces at rubyforge.org] On Behalf Of Jonathan Linowes Sent: Monday, June 11, 2007 11:23 PM To: rspec-users Subject: [rspec-users] rdebug spec ? Can you run rdebug on specs? I get errors when I try: $ rdebug spec ./spec/models/select_option_spec.rb ./spec: Is a directory - ./spec (Errno::EISDIR) from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ rdebug:136:in `debug_load'' from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ rdebug:136 from /opt/local/bin/rdebug:16:in `load'' from /opt/local/bin/rdebug:16 _______________________________________________ rspec-users mailing list rspec-users at rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
As I said in #ruby-lang (I thought it may be helpful to someone else)... For those of you using textmate, I''ve setup a snippet called rdebug, which adds the following: require ''rubygems''; require ''ruby-debug''; debugger Usually I only do this as a last resort. My workflow goes as follows: I run my spec suite for the newest spec. If it fails and I simply cannot figure out why, I add this snippet before the line which fails (inside the spec), and then rerun the spec suite. Since I use a failure file, it will only run this spec, and dump me right before the spec fails. Hope that helps, Scott On Jun 12, 2007, at 2:37 AM, Luis Lavena wrote:> On 6/12/07, Jonathan Linowes <jonathan at parkerhill.com> wrote: >> Can you run rdebug on specs? >> >> I get errors when I try: >> >> $ rdebug spec ./spec/models/select_option_spec.rb >> ./spec: Is a directory - ./spec (Errno::EISDIR) >> from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ >> rdebug:136:in `debug_load'' >> from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ >> rdebug:136 >> from /opt/local/bin/rdebug:16:in `load'' >> from /opt/local/bin/rdebug:16 >> > > Try the following: > > require ''ruby-debug'' at top of your spec file. > > then, put ''debugger'' inside your example block. > > That worked for me, also in combination with spec -e (just to run a > specific example to pinpoint the problem). > > HTH, > > -- > Luis Lavena > Multimedia systems > - > Leaders are made, they are not born. They are made by hard effort, > which is the price which all of us must pay to achieve any goal that > is worthwhile. > Vince Lombardi > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
ruby-debug works nice, I can put the breakpoint in my app rather than the spec examples. thanks On Jun 12, 2007, at 2:40 AM, James Deville wrote:> Since this appears to be for Rails, get ruby-debug instead. Then > you just > have to put ''debugger'' in where you want to enter your code. It > works great. > > Otherwise, it may still work, but it will probably require > configuration. > > The other option is to see what rdebug''s version of the -I switch > is. For > ruby (command line) -I followed by the library path makes that > library get > loaded. > > -----Original Message----- > From: rspec-users-bounces at rubyforge.org > [mailto:rspec-users-bounces at rubyforge.org] On Behalf Of Jonathan > Linowes > Sent: Monday, June 11, 2007 11:23 PM > To: rspec-users > Subject: [rspec-users] rdebug spec ? > > Can you run rdebug on specs? > > I get errors when I try: > > $ rdebug spec ./spec/models/select_option_spec.rb > ./spec: Is a directory - ./spec (Errno::EISDIR) > from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ > rdebug:136:in `debug_load'' > from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ > rdebug:136 > from /opt/local/bin/rdebug:16:in `load'' > from /opt/local/bin/rdebug:16 > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
On 6/12/07, Jonathan Linowes <jonathan at parkerhill.com> wrote:> ruby-debug works nice, I can put the breakpoint in my app rather than > the spec examples. > thanks > > On Jun 12, 2007, at 2:40 AM, James Deville wrote: > > > Since this appears to be for Rails, get ruby-debug instead. Then > > you just > > have to put ''debugger'' in where you want to enter your code. It > > works great. > > > > Otherwise, it may still work, but it will probably require > > configuration.rdebug is the command that gets installed with ruby-debug, so we''re all talking about the same thing. To run a single spec file, just do this: rdebug ./spec/models/select_option_spec.rb You can put ''debugger'' in your files or not. It''s up to you. In practice sometimes I do, sometimes I don''t. Cheers, David> > > > The other option is to see what rdebug''s version of the -I switch > > is. For > > ruby (command line) -I followed by the library path makes that > > library get > > loaded. > > > > -----Original Message----- > > From: rspec-users-bounces at rubyforge.org > > [mailto:rspec-users-bounces at rubyforge.org] On Behalf Of Jonathan > > Linowes > > Sent: Monday, June 11, 2007 11:23 PM > > To: rspec-users > > Subject: [rspec-users] rdebug spec ? > > > > Can you run rdebug on specs? > > > > I get errors when I try: > > > > $ rdebug spec ./spec/models/select_option_spec.rb > > ./spec: Is a directory - ./spec (Errno::EISDIR) > > from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ > > rdebug:136:in `debug_load'' > > from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ > > rdebug:136 > > from /opt/local/bin/rdebug:16:in `load'' > > from /opt/local/bin/rdebug:16 > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Good to know, I thought they were completely separate. -----Original Message----- From: rspec-users-bounces at rubyforge.org [mailto:rspec-users-bounces at rubyforge.org] On Behalf Of David Chelimsky Sent: Tuesday, June 12, 2007 4:46 AM To: rspec-users Subject: Re: [rspec-users] rdebug spec ? On 6/12/07, Jonathan Linowes <jonathan at parkerhill.com> wrote:> ruby-debug works nice, I can put the breakpoint in my app rather than > the spec examples. > thanks > > On Jun 12, 2007, at 2:40 AM, James Deville wrote: > > > Since this appears to be for Rails, get ruby-debug instead. Then > > you just > > have to put ''debugger'' in where you want to enter your code. It > > works great. > > > > Otherwise, it may still work, but it will probably require > > configuration.rdebug is the command that gets installed with ruby-debug, so we''re all talking about the same thing. To run a single spec file, just do this: rdebug ./spec/models/select_option_spec.rb You can put ''debugger'' in your files or not. It''s up to you. In practice sometimes I do, sometimes I don''t. Cheers, David> > > > The other option is to see what rdebug''s version of the -I switch > > is. For > > ruby (command line) -I followed by the library path makes that > > library get > > loaded. > > > > -----Original Message----- > > From: rspec-users-bounces at rubyforge.org > > [mailto:rspec-users-bounces at rubyforge.org] On Behalf Of Jonathan > > Linowes > > Sent: Monday, June 11, 2007 11:23 PM > > To: rspec-users > > Subject: [rspec-users] rdebug spec ? > > > > Can you run rdebug on specs? > > > > I get errors when I try: > > > > $ rdebug spec ./spec/models/select_option_spec.rb > > ./spec: Is a directory - ./spec (Errno::EISDIR) > > from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ > > rdebug:136:in `debug_load'' > > from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ > > rdebug:136 > > from /opt/local/bin/rdebug:16:in `load'' > > from /opt/local/bin/rdebug:16 > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >_______________________________________________ rspec-users mailing list rspec-users at rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users
On 6/12/07, James Deville <james.deville at gmail.com> wrote:> Good to know, I thought they were completely separate.FYI - http://viewvc.rubyforge.mmmultiworks.com/cgi/viewvc.cgi/trunk/bin/rdebug?root=ruby-debug&view=log Cheers, David> > > -----Original Message----- > From: rspec-users-bounces at rubyforge.org > [mailto:rspec-users-bounces at rubyforge.org] On Behalf Of David Chelimsky > Sent: Tuesday, June 12, 2007 4:46 AM > To: rspec-users > Subject: Re: [rspec-users] rdebug spec ? > > On 6/12/07, Jonathan Linowes <jonathan at parkerhill.com> wrote: > > ruby-debug works nice, I can put the breakpoint in my app rather than > > the spec examples. > > thanks > > > > On Jun 12, 2007, at 2:40 AM, James Deville wrote: > > > > > Since this appears to be for Rails, get ruby-debug instead. Then > > > you just > > > have to put ''debugger'' in where you want to enter your code. It > > > works great. > > > > > > Otherwise, it may still work, but it will probably require > > > configuration. > > rdebug is the command that gets installed with ruby-debug, so we''re > all talking about the same thing. To run a single spec file, just do > this: > > rdebug ./spec/models/select_option_spec.rb > > You can put ''debugger'' in your files or not. It''s up to you. In > practice sometimes I do, sometimes I don''t. > > Cheers, > David > > > > > > > > The other option is to see what rdebug''s version of the -I switch > > > is. For > > > ruby (command line) -I followed by the library path makes that > > > library get > > > loaded. > > > > > > -----Original Message----- > > > From: rspec-users-bounces at rubyforge.org > > > [mailto:rspec-users-bounces at rubyforge.org] On Behalf Of Jonathan > > > Linowes > > > Sent: Monday, June 11, 2007 11:23 PM > > > To: rspec-users > > > Subject: [rspec-users] rdebug spec ? > > > > > > Can you run rdebug on specs? > > > > > > I get errors when I try: > > > > > > $ rdebug spec ./spec/models/select_option_spec.rb > > > ./spec: Is a directory - ./spec (Errno::EISDIR) > > > from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ > > > rdebug:136:in `debug_load'' > > > from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ > > > rdebug:136 > > > from /opt/local/bin/rdebug:16:in `load'' > > > from /opt/local/bin/rdebug:16 > > > > > > _______________________________________________ > > > rspec-users mailing list > > > rspec-users at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > > > _______________________________________________ > > > rspec-users mailing list > > > rspec-users at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/rspec-users > > > > _______________________________________________ > > rspec-users mailing list > > rspec-users at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rspec-users > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
I''ve enjoyed it. Sometimes it''s also nice to drop the breakpoint in the spec to inspect the response object. Glad I could help. JD -----Original Message----- From: rspec-users-bounces at rubyforge.org [mailto:rspec-users-bounces at rubyforge.org] On Behalf Of Jonathan Linowes Sent: Tuesday, June 12, 2007 1:39 AM To: rspec-users Subject: Re: [rspec-users] rdebug spec ? ruby-debug works nice, I can put the breakpoint in my app rather than the spec examples. thanks On Jun 12, 2007, at 2:40 AM, James Deville wrote:> Since this appears to be for Rails, get ruby-debug instead. Then > you just > have to put ''debugger'' in where you want to enter your code. It > works great. > > Otherwise, it may still work, but it will probably require > configuration. > > The other option is to see what rdebug''s version of the -I switch > is. For > ruby (command line) -I followed by the library path makes that > library get > loaded. > > -----Original Message----- > From: rspec-users-bounces at rubyforge.org > [mailto:rspec-users-bounces at rubyforge.org] On Behalf Of Jonathan > Linowes > Sent: Monday, June 11, 2007 11:23 PM > To: rspec-users > Subject: [rspec-users] rdebug spec ? > > Can you run rdebug on specs? > > I get errors when I try: > > $ rdebug spec ./spec/models/select_option_spec.rb > ./spec: Is a directory - ./spec (Errno::EISDIR) > from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ > rdebug:136:in `debug_load'' > from /opt/local/lib/ruby/gems/1.8/gems/ruby-debug-0.9.3/bin/ > rdebug:136 > from /opt/local/bin/rdebug:16:in `load'' > from /opt/local/bin/rdebug:16 > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users_______________________________________________ rspec-users mailing list rspec-users at rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users