SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Sep 2008
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What to do when you make an error in console?

    Hello,

    What are you supposed to do when you make an error typing in the Ruby console? I am on p.137 in Simply Rails and made a typo. What do you do to get back on track after that? I have attached a screenshot.

    Thanks so much for your help!
    Attached Images Attached Images

  2. #2
    SitePoint Evangelist
    Join Date
    Feb 2006
    Location
    Worcs. UK
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In your example, once you get back to the console with a line starting >> you should be able re-enter the command with the correct coding. Re-entering should overwrite the previous entry.

    To leave the console, enter exit at the console prompt (>>).

    If you have a console open and have changed code in your editor, the change will not take immediate effect. You either have to exit or re-enter the console, or more usefully, enter reload! at the console prompt.

  3. #3
    SitePoint Member
    Join Date
    Sep 2008
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do I get back to the line starting with ">>" ? Is there something I should type? I just typed .quit and that seemed to work, but I'm not sure if that was the appropriate action.

    Thanks for the help ReggieB!

  4. #4
    SitePoint Evangelist
    Join Date
    Feb 2006
    Location
    Worcs. UK
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In the example you give, the problem was that you'd open a new text input (with the initail ') and hadn't closed it. The system was letting you enter more text until you closed the text entry or caused an error. So one way to get out of the problem would just have been to enter another closing ' and then carriage return. However, often you can get stuck and usually either ctrl-z or ctrl-c or a combination of both.

    In the attached screen shot, I've replicated your problem in irb. I then used both ways to return to a standard prompt. In the second example, it was a combination of a ctrl-c and then a ctrl-z that got me back to >
    Attached Images Attached Images

  5. #5
    SitePoint Member
    Join Date
    Sep 2008
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got it. Thanks Reggie! I am new so I am trying to make sense of all of this. That helps.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •