2012-03-21 19 views
6

मैंने पतला टेम्पलेट इंजन आज़माने का फैसला किया, लेकिन मुझे अजीब त्रुटि है।स्लिम सिंटेक्स त्रुटि

ActionView::Template::Error (Unknown line indicator 
    app/views/layouts/application.html.slim, Line 1 
    <!DOCTYPE html> 
    ^
): 
    slim (1.1.1) lib/slim/parser.rb:448:in `syntax_error!' 

यह सभी पृष्ठों पर दिखाई देता है। उदाहरण के लिए:

Started GET "/" for 127.0.0.1 at 2012-03-21 09:47:49 +0400 
Processing by AuthenticationsController#index as HTML 
    Authentication Load (0.9ms) SELECT "authentications".* FROM "authentications" 
    User Load (1.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = 17 LIMIT 1 
    CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = 17 LIMIT 1 
    Rendered authentications/index.html.slim within layouts/application (88.4ms) 

मैं अपने Gemfile में gem 'slim-rails' और

है

विचारों/प्रमाणीकरणों/index.html.slim:

table 
    tr 
    th User 
    th Provider 
    th Uid 
    - for authentication in @authentications 
    tr 
     td = authentication.user_id 
     td = authentication.provider 
     td = authentication.uid 
     td = link_to "Destroy", authentication, :confirm => 'Are you sure?', :method => :delete 

विचारों/लेआउट/application.html.slim:

doctype 5 
html 
    head 
    title gttc 
    = stylesheet_link_tag "application", :media => "all" 
    = javascript_include_tag "application" 
    = csrf_meta_tags 
    body 
    p hi! 
    = yield 

मैं इस त्रुटि का कारण नहीं समझ सकता। ऐसा लगता है जैसे स्लिम पार्सर पहले से जेनरेट किए गए एचटीएमएल को पार्स करने की कोशिश कर रहा है। पर क्यों? मेरी गलती कहां है?

उत्तर

2

समस्या हल हो गई। जब मैंने अपना आईडीई (रूबीमाइन) फिर से शुरू किया, तो मैंने देखा कि किसी कारण से फ़ाइल .html.slim में पुराने .html.erb से टेक्स्ट शामिल था। तो शायद यह rubymine में किसी तरह की एक त्रुटि थी।

+0

क्या आप समझा सकते हैं कि आपको थोड़ा और क्या पता चला? मैं एक ही त्रुटि से गुजर रहा हूं और ऐसा लगता है कि यह मेरे स्थानीय पर्यावरण के लिए अलग-अलग और अलग है। धन्यवाद! –

संबंधित मुद्दे