Skip to content
This repository
Browse code

and one more time

  • Loading branch information...
commit d6c831c198baee2542a070c62f1608f88fe60e34 1 parent 67ede88
Aditya Sanghi authored April 24, 2012
4  activesupport/lib/active_support/core_ext/kernel/debugger.rb
... ...
@@ -1,8 +1,8 @@
1 1
 module Kernel
2 2
   unless respond_to?(:debugger)
3  
-    # Starts a debugging session if a debugger has been loaded (call rails server --debugger to do load it).
  3
+    # Starts a debugging session if the +debugger+ gem has been loaded (call rails server --debugger to do load it).
4 4
     def debugger
5  
-      message = "\n***** Debugger requested, but was not available (ensure debugger is listed in Gemfile/installed as gem): Start server with --debugger to enable *****\n"
  5
+      message = "\n***** Debugger requested, but was not available (ensure the debugger gem is listed in Gemfile/installed as gem): Start server with --debugger to enable *****\n"
6 6
       defined?(Rails) ? Rails.logger.info(message) : $stderr.puts(message)
7 7
     end
8 8
     alias breakpoint debugger unless respond_to?(:breakpoint)
4  guides/code/getting_started/README.rdoc
Source Rendered
@@ -86,8 +86,8 @@ programming in general.
86 86
 Debugger support is available through the debugger command when you start your
87 87
 Mongrel or WEBrick server with --debugger. This means that you can break out of
88 88
 execution at any point in the code, investigate and change the model, and then,
89  
-resume execution! You need to install a debugger to run the server in debugging
90  
-mode. With gems, use <tt>gem install debugger</tt>. Example:
  89
+resume execution! You need to install the 'debugger' gem to run the server in debugging
  90
+mode. Add gem 'debugger' to your Gemfile and run <tt>bundle</tt> to install it. Example:
91 91
 
92 92
   class WeblogController < ActionController::Base
93 93
     def index
21  guides/source/debugging_rails_applications.textile
Source Rendered
@@ -191,7 +191,7 @@ Completed in 0.01224 (81 reqs/sec) | DB: 0.00044 (3%) | 302 Found [http://localh
191 191
 
192 192
 Adding extra logging like this makes it easy to search for unexpected or unusual behavior in your logs. If you add extra logging, be sure to make sensible use of log levels, to avoid filling your production logs with useless trivia.
193 193
 
194  
-h3. Debugging with +debugger+ gem
  194
+h3. Debugging with the +debugger+ gem
195 195
 
196 196
 When your code is behaving in unexpected ways, you can try printing to logs or the console to diagnose the problem. Unfortunately, there are times when this sort of error tracking is not effective in finding the root cause of a problem. When you actually need to journey into your running source code, the debugger is your best companion.
197 197
 
@@ -199,19 +199,13 @@ The debugger can also help you if you want to learn about the Rails source code
199 199
 
200 200
 h4. Setup
201 201
 
202  
-The debugger used by Rails, +debugger+, comes as a gem. To install it, just run:
  202
+Rails uses the +debugger+ gem to set breakpoints and step through live code. To install it, just run:
203 203
 
204 204
 <shell>
205 205
 $ gem install debugger
206 206
 </shell>
207 207
 
208  
-TIP: If you are using Ruby 1.9, you can install a compatible version of +ruby-debug+ by running +gem install debugger+
209  
-
210  
-In case you want to download a particular version or get the source code, refer to the "project's page on rubyforge":http://rubyforge.org/projects/ruby-debug/.
211  
-
212  
-Rails has had built-in support for ruby-debug since Rails 2.0. Inside any Rails application you can invoke the debugger by calling the +debugger+ method.
213  
-
214  
-+ruby-debug19+ gem has been replaced by the +debugger+ gem due to multiple issues on Ruby 1.9.3.
  208
+Rails has had built-in support for debugging since Rails 2.0. Inside any Rails application you can invoke the debugger by calling the +debugger+ method.
215 209
 
216 210
 Here's an example:
217 211
 
@@ -272,7 +266,7 @@ continue   edit     frame   method  putl  set      tmate   where
272 266
 
273 267
 TIP: To view the help menu for any command use +help &lt;command-name&gt;+ in active debug mode. For example: _+help var+_
274 268
 
275  
-The next command to learn is one of the most useful: +list+. You can also abbreviate the debugging commands by supplying just enough letters to distinguish them from other commands, so you can also use +l+ for the +list+ command.
  269
+The next command to learn is one of the most useful: +list+. You can abbreviate any debugging command by supplying just enough letters to distinguish them from other commands, so you can also use +l+ for the +list+ command.
276 270
 
277 271
 This command shows you where you are in the code by printing 10 lines centered around the current line; the current line in this particular case is line 6 and is marked by +=>+.
278 272
 
@@ -487,7 +481,7 @@ class Author < ActiveRecord::Base
487 481
 end
488 482
 </ruby>
489 483
 
490  
-TIP: You can use a debugger while using +rails console+. Just remember to +require "debugger"+ before calling the +debugger+ method.
  484
+TIP: You can use the debugger while using +rails console+. Just remember to +require "debugger"+ before calling the +debugger+ method.
491 485
 
492 486
 <shell>
493 487
 $ rails console
@@ -605,7 +599,7 @@ A simple quit tries to terminate all threads in effect. Therefore your server wi
605 599
 
606 600
 h4. Settings
607 601
 
608  
-There are some settings that can be configured in the +debugger+ gem to make it easier to debug your code. Here are a few of the available options:
  602
+The +debugger+ gem can automatically show the code you're stepping through and reload it when you change it in an editor. Here are a few of the available options:
609 603
 
610 604
 * +set reload+: Reload source code when changed.
611 605
 * +set autolist+: Execute +list+ command on every breakpoint.
@@ -614,7 +608,7 @@ There are some settings that can be configured in the +debugger+ gem to make it
614 608
 
615 609
 You can see the full list by using +help set+. Use +help set _subcommand_+ to learn about a particular +set+ command.
616 610
 
617  
-TIP: You can include any number of these configuration lines inside a +.rdebugrc+ file in your HOME directory. +debugger+ gem will read this file every time it is loaded and configure itself accordingly.
  611
+TIP: You can save these settings in an +.rdebugrc+ file in your home directory. The debugger reads these global settings when it starts.
618 612
 
619 613
 Here's a good start for an +.rdebugrc+:
620 614
 
@@ -708,7 +702,6 @@ h3. References
708 702
 * "debugger Homepage":http://github.com/cldwalker/debugger
709 703
 * "Article: Debugging a Rails application with ruby-debug":http://www.sitepoint.com/article/debug-rails-app-ruby-debug/
710 704
 * "ruby-debug Basics screencast":http://brian.maybeyoureinsane.net/blog/2007/05/07/ruby-debug-basics-screencast/
711  
-* "Ryan Bates' ruby-debug screencast":http://railscasts.com/episodes/54-debugging-with-ruby-debug
712 705
 * "Ryan Bates' debugging ruby (revised) screencast":http://railscasts.com/episodes/54-debugging-ruby-revised
713 706
 * "Ryan Bates' stack trace screencast":http://railscasts.com/episodes/24-the-stack-trace
714 707
 * "Ryan Bates' logger screencast":http://railscasts.com/episodes/56-the-logger
4  railties/lib/rails/commands/console.rb
@@ -27,7 +27,7 @@ def options
27 27
           opt.on("-e", "--environment=name", String,
28 28
                   "Specifies the environment to run this console under (test/development/production).",
29 29
                   "Default: development") { |v| options[:environment] = v.strip }
30  
-          opt.on("--debugger", 'Enable ruby debugging for the console.') { |v| options[:debugger] = v }
  30
+          opt.on("--debugger", 'Enable the debugger.') { |v| options[:debugger] = v }
31 31
           opt.parse!(arguments)
32 32
         end
33 33
 
@@ -76,7 +76,7 @@ def require_debugger
76 76
         require 'debugger'
77 77
         puts "=> Debugger enabled"
78 78
       rescue Exception
79  
-        puts "You need to install a debugger to run the console in debugging mode. With gems, use 'gem install debugger'"
  79
+        puts "You're missing the 'debugger' gem. Add it to your Gemfile, bundle, and try again."
80 80
         exit
81 81
       end
82 82
     end
2  railties/lib/rails/commands/server.rb
@@ -17,7 +17,7 @@ def parse!(args)
17 17
           opts.on("-c", "--config=file", String,
18 18
                   "Use custom rackup configuration file") { |v| options[:config] = v }
19 19
           opts.on("-d", "--daemon", "Make server run as a Daemon.") { options[:daemonize] = true }
20  
-          opts.on("-u", "--debugger", "Enable ruby debugging for the server.") { options[:debugger] = true }
  20
+          opts.on("-u", "--debugger", "Enable the debugger") { options[:debugger] = true }
21 21
           opts.on("-e", "--environment=name", String,
22 22
                   "Specifies the environment to run this server under (test/development/production).",
23 23
                   "Default: development") { |v| options[:environment] = v }
4  railties/lib/rails/generators/rails/app/templates/README
@@ -86,8 +86,8 @@ programming in general.
86 86
 Debugger support is available through the debugger command when you start your
87 87
 Mongrel or WEBrick server with --debugger. This means that you can break out of
88 88
 execution at any point in the code, investigate and change the model, and then,
89  
-resume execution! You need to install a debugger to run the server in debugging
90  
-mode. With gems, use <tt>gem install debugger</tt>. Example:
  89
+resume execution! You need to install the 'debugger' gem to run the server in debugging
  90
+mode. Add gem 'debugger' to your Gemfile and run <tt>bundle</tt> to install it. Example:
91 91
 
92 92
   class WeblogController < ActionController::Base
93 93
     def index
2  railties/lib/rails/rack/debugger.rb
@@ -12,7 +12,7 @@ def initialize(app)
12 12
         ::Debugger.settings[:autoeval] = true if ::Debugger.respond_to?(:settings)
13 13
         puts "=> Debugger enabled"
14 14
       rescue LoadError
15  
-        puts "You need to install a debugger to run the server in debugging mode. With gems, use 'gem install debugger'"
  15
+        puts "You're missing the 'debugger' gem. Add it to your Gemfile, bundle, and try again."
16 16
         exit
17 17
       end
18 18
 

0 notes on commit d6c831c

Please sign in to comment.
Something went wrong with that request. Please try again.