SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Newbie - Stuck Creating Records, HELP!

    First, clarification... I am a newbie. When I say newbie, I have never programmed before in my life. I learned HTML last month and I am working on Ruby this month (I hadn't even heard of Ruby before that). I can't remember the last time I used a command prompt.

    My problem (at least my current problem) arises in using Lenz's book on page 128, Creating Records. The command "S = Story.new" works fine and my results match those provided in the book. However, when I enter "s.name = `My Shiny weblog'", my command prompt does nothing. It just sits there with the cursor blinking like no command has been entered. It also will not let me exit out or process any other command. Any thoughts or guidance?

    As some background, I am using Windows Vista. My setup of InstantRails went okay, but I had some errors with the Gem installation. I used the version of Instant Rails suggested in the book.

    I have also been having issues with MySQL but I seemed to have resolved them, at least temporarily. Using InstantRails, I still cannot get the MySQL to start in the InstantRails console as it is already running. I have tried to stop it through the Task Manager, but that seems to screw up my work in the Rails Command Prompt. This overall problem could have been caused by my initial setup of MySQL prior to the InstantRails setup process (at the urging of a programmer friend). Does anybody have any thoughts on how to reconcile this issue? It wouldn't surprise me if this was causing my problem above.

    I apologize if this question has already been asked. I also apologize if my description is not the clearest. As I mentioned, I have never done any programming before. I guess I have to start somewhere.

  2. #2
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's probably a typo but start variable names with lowercase letters:
    s = Story.new

    In the line that hangs, are you using a backtick (the key beside the number 1 at the upper left of keyboards)? It should be an apostrophe like how you ended the string:
    s.name = 'My Shiny weblog'

  3. #3
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, the backtick was the problem. I appreciate the help. Hopefully that will get me through the next few pages!

  4. #4
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried stopping mysql (using the task manager) before you start instantrails? When you started instantrails, it will have tried to start mysql, but this failed as mysql was already running. If you close mysql now, instantrails will not try to start mysql again. At this point there will be no mysql process running so you get errors if you try to use mysql via rails.

  5. #5
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the input. I will definitely try that. I believe that I tried it before, but I have done so many things I can't remember.

    With that said, I think it everything is running okay. I took the time to go through and double check my work in Lenz's book up to this point. I have been able to get through all of my problems up to this point. I'm getting more comfortable with the programming language so its easier to find things when I do screw up. I'm sure I'll have more issues though.


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
  •