SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member Develober's Avatar
    Join Date
    May 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question proplem With db:migrate after generate scaffold

    Hello guys im new to RoR
    i was reading Agile Web Development 3rd Edition, i use sqlite3 rails 2.2.2
    after i do :
    ruby script/generate scaffold product \title:string description:text image_url:string
    it goes ok but when Try to rake db:migrate gives me this error


    C:\Sites\cart>rake db:migrate
    (in C:/Sites/cart)
    rake aborted!
    ./db/migrate//20090526045759_create_products.rb:4: syntax error, unexpected $und
    efined, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END

    t.string :\title
    ^

    (See full trace by running task with --trace)

    Now When i Use The Trace GIves me this

    C:\Sites\cart>rake db:migrate --trace
    (in C:/Sites/cart)
    ** Invoke db:migrate (first_time)
    ** Invoke environment (first_time)
    ** Execute environment
    ** Execute db:migrate
    rake aborted!
    ./db/migrate//20090526045759_create_products.rb:4: syntax error, unexpected $und
    efined, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END

    t.string :\title
    ^
    c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
    es.rb:142:in `load_without_new_constant_marking'
    c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
    es.rb:142:in `load'
    c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
    es.rb:521:in `new_constants_in'
    c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependenci
    es.rb:142:in `load'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb
    :367:in `load_migration'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb
    :363:in `migration'
    (__DELEGATION__):2:in `migrate'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb
    :480:in `migrate'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb
    :556:in `call'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb
    :556:in `ddl_transaction'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb
    :479:in `migrate'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb
    :466:in `each'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb
    :466:in `migrate'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb
    :394:in `up'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/migration.rb
    :377:in `migrate'
    c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/tasks/databases.rake:111
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_c
    hain'
    c:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_c
    hain'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exceptio
    n_handling'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exceptio
    n_handling'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
    c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
    c:/ruby/bin/rake:19:in `load'
    c:/ruby/bin/rake:19


    Well i Dont Know What is The Issue Please if Can Some one Help me With
    And my Gem list is :


    *** LOCAL GEMS ***

    actionmailer (2.2.2)
    actionpack (2.2.2)
    activerecord (2.2.2)
    activeresource (2.2.2)
    activesupport (2.2.2)
    fxri (0.3.6)
    fxruby (1.6.12)
    hpricot (0.6)
    log4r (1.0.5)
    rails (2.2.2)
    rake (0.8.7, 0.7.3)
    sources (0.0.1)
    sqlite3-ruby (1.2.3)
    win32-api (1.0.4)
    win32-clipboard (0.4.3)
    win32-dir (0.3.2)
    win32-eventlog (0.4.6)
    win32-file (0.5.4)
    win32-file-stat (1.2.7)
    win32-process (0.5.3)
    win32-sapi (0.1.4)
    win32-sound (0.4.1)
    windows-api (0.2.0)
    windows-pr (0.7.2)

    My Greet Develober

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Is that slash before title supposed to be there? That seems to be what the parser is complaining about.

  3. #3
    SitePoint Member Develober's Avatar
    Join Date
    May 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mmm I think its The Proplem i will open the Migrate File and See if That \ in There....

    Well You Were Right About That it Was that Slash "\" .

    Thanks For Help Mr. Dan
    The Wrong is Me And I Shall See, The Wrong is us And We All Rocks


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
  •