2014-10-17 40 views
0

我的sinatra應用程序使用了Jammit的assets.yml文件。Jammit和分組軟件包括

下面是我想要完成但不能完成的一個例子。

application: &application 
    - app/assets/js/vendor/jquery-2.1.1.js 
    - app/assets/js/vendor/underscore.js 
    - app/assets/js/underscore.strings.js 


    other_app: 
    - <<: *application 
    - app/assets/js/underscore.strings.js 
    - app/assets/js/vendor/angularjs/angular.js 
    - app/assets/js/vendor/angularjs/angular-sanitize.js 
    - app/assets/js/vendor/angular_plugins/**/*.js 

這是我得到

no implicit conversion of Hash into String 

這是很容易爲包括我的佈局其他包的錯誤,但是這意味着越來越多的請求,我能不容易意味着需要資產訂單。 (例如,此包需要在之前包含角)。

堅持半天的谷歌搜索導致什麼都沒有! 謝謝!

+0

我相信,只有其壓痕問題,沒有別的。您可以在http://yaml-online-parser.appspot.com/上驗證您的.yml內容。並嘗試它,清楚地表明它無法正確解析它。 – 2014-10-17 21:21:07

回答

0

我猜只是它的縮進問題,沒有別的。您可以在

http://yaml-online-parser.appspot.com/ 

,並試圖驗證.yml內容,清楚地表明,它不能夠正確地解析它。複製下面的內容完全相同的方式,它會開始解析正確:

application: &application 
    - app/assets/js/vendor/jquery-2.1.1.js 
    - app/assets/js/vendor/underscore.js 
    - app/assets/js/underscore.strings.js 


other_app: 
    - <<: *application 
    - app/assets/js/underscore.strings.js 
    - app/assets/js/vendor/angularjs/angular.js 
    - app/assets/js/vendor/angularjs/angular-sanitize.js 
    - app/assets/js/vendor/angular_plugins/**/*.js 

它只有1空間的差異。檢查此鏈接:http://goo.gl/mUFNud

希望它能幫助:)

0

答案是以下

application: &application 
    - app/assets/js/vendor/jquery-2.1.1.js 
    - app/assets/js/vendor/underscore.js 
    - app/assets/js/underscore.strings.js 


    other_app: 
    - *application 
    - app/assets/js/underscore.strings.js 
    - app/assets/js/vendor/angularjs/angular.js 
    - app/assets/js/vendor/angularjs/angular-sanitize.js 
    - app/assets/js/vendor/angular_plugins/**/*.js 

沒有< <:只要*應用