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

Ticket #10637: reworded_and_include_ruby_debug_homepage.2.diff

File reworded_and_include_ruby_debug_homepage.2.diff, 3.6 kB (added by jamesh, 8 months ago)
  • railties/README

    old new  
    3131   and your application name. Ex: rails myapp 
    3232   (If you've downloaded Rails in a complete tgz or zip, this step is already done) 
    33332. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options) 
    34 3. Go to http://localhost:3000/ and get "Welcome aboard: You’re riding the Rails!" 
     343. Go to http://localhost:3000 and get "Welcome aboard: You’re riding the Rails!" 
    35354. Follow the guidelines to start developing your application 
    3636 
    3737 
    3838== Web Servers 
    3939 
    4040By default, Rails will try to use Mongrel and lighttpd if they are installed, otherwise 
    41 Rails will use WEBrick, the webserver that ships with Ruby. When you run script/server
     41Rails will use WEBrick, the webserver that ships with Ruby. When you run <tt>script/server</tt>
    4242Rails will check if Mongrel exists, then lighttpd and finally fall back to WEBrick. This ensures 
    4343that you can always get up and running quickly. 
    4444 
     
    8787 
    8888  Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1 
    8989 
    90 More information on how to use the logger is at http://www.ruby-doc.org/core/ 
     90More information on how to use the logger is at http://www.ruby-doc.org/core 
    9191 
    92 Also, Ruby documentation can be found at http://www.ruby-lang.org/ including: 
     92Also, Ruby documentation can be found at http://www.ruby-lang.org including: 
    9393 
    94 * The Learning Ruby (Pickaxe) Book: http://www.ruby-doc.org/docs/ProgrammingRuby/ 
    95 * Learn to Program: http://pine.fm/LearnToProgram/  (a beginners guide) 
     94* The Learning Ruby (Pickaxe) Book: http://www.ruby-doc.org/docs/ProgrammingRuby 
     95* Learn to Program: http://pine.fm/LearnToProgram  (a beginners guide) 
    9696 
    9797These two online (and free) books will bring you up to speed on the Ruby language 
    9898and also on programming in general. 
     
    100100 
    101101== Debugger 
    102102 
    103 Debugger support is available through the debugger command when you start your Mongrel or 
    104 Webrick server with --debugger. This means that you can break out of execution at any point 
    105 in the code, investigate and change the model, AND then resume execution! Example: 
     103With debugger, you can break out of execution at any point in the application, examine objects, 
     104step through the code, change things like values of variables, and resume execution. To use  
     105debugger, you need to install the ruby-debug gem (simply run: <tt>gem install ruby-debug</tt>). Put  
     106<tt>debugger</tt> in your code where you want to stop the execution and begin to use debugger. You  
     107will also need to start your Mongrel or WEBrick server with --debugger or -u option (E.g.  
     108<tt>script/server -u</tt>). Here's an example: 
    106109 
    107110  class WeblogController < ActionController::Base 
    108111    def index 
     
    111114    end 
    112115  end 
    113116 
    114 So the controller will accept the action, run the first line, then present you 
    115 with a IRB prompt in the server window. Here you can do things like: 
     117So the controller will accept the action, run the first line, then present you with a IRB prompt  
     118in the server window. Here you can do things like: 
    116119 
    117120  >> @posts.inspect 
    118121  => "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>, 
     
    127130  >> f. 
    128131  Display all 152 possibilities? (y or n) 
    129132 
    130 Finally, when you're ready to resume execution, you enter "cont" 
     133Finally, when you're ready to resume normal execution, run ruby-debug's <tt>cont</tt> command. 
    131134 
     135For more details on how to use ruby-debug, please see its project page:  
     136http://rubyforge.org/projects/ruby-debug/ 
    132137 
    133138== Console 
    134139