今日、私は不可解な問題に遭遇し、数時間検索した後、何が問題なのかを見つけることができません. Rails アプリケーションに jquery mobile を含めようとしています。ライブラリファイルを手動で参照することと、jquery_mobile_rails gem を使用することの両方を試みました。ライブラリをアプリケーションに挿入する限り、どちらの方法も機能しますが、jquery モバイルを追加するとすぐに、アプリケーションが読み込まれなくなります。ページを更新しても読み込まれません。コンソールに 3 つのエラーがあります。
1位:
Uncaught TypeError: Object <Ember.ArrayResourceController:ember141> has no method '_resourceRequest'
Jimux.appsMetaController.Em.ArrayResourceController.create.findAll
newFunc
(anonymous function)
(anonymous function)
(anonymous function) jquery.js:566
jQuery.extend.globalEval jquery.js:567
jQuery.ajaxSetup.converters.text script jquery.js:8107
ajaxConvert jquery.js:7992
done jquery.js:7628
callback jquery.js:8367
send jquery.js:8373
jQuery.extend.ajax jquery.js:7835
(anonymous function) jquery.js:5858
jQuery.extend.each jquery.js:613
jQuery.fn.extend.domManip jquery.js:5855
jQuery.fn.extend.append jquery.js:5628
jQuery.fn.extend.wrapAll jquery.js:5585
(anonymous function) jquery.js:5603
jQuery.extend.each jquery.js:613
jQuery.fn.jQuery.each jquery.js:243
jQuery.fn.extend.wrapInner jquery.js:5598
$.extend.initializePage jquery.mobile-1.2.0.js:9063
(anonymous function) jquery.mobile-1.2.0.js:9142
fire jquery.js:976
self.fireWith jquery.js:1084
jQuery.extend.ready jquery.js:408
DOMContentLoaded
2番目:
Uncaught TypeError: Cannot call method 'set' of undefined
Ember.Application.registerInjection.injection
(anonymous function)
(anonymous function)
visit
DAG.topsort
Ember.Application.Ember.Namespace.extend.runInjections
Ember.Application.Ember.Namespace.extend.initialize
(anonymous function)
fire
self.fireWith
jQuery.extend.ready
3番目:
GET http://localhost:3000/assets/images/ajax-loader.gif 404 (Not Found)
//= require jquery.mobile-1.2.0
から削除するとすぐにapplication.js
、アプリは再び期待どおりに動作し、上記のエラーは発生しません。ここで何が起こっているのだろうと思っています。名前空間の競合が発生している可能性があると思いますが、これが事実であるかどうか、およびそれを特定して修正する方法はわかりません。
この問題のデバッグに関するヘルプをいただければ幸いです。Rails プロジェクトで Embeejs+jQueryMobile を使用している場合は、Rails アプリケーションに 2 つのライブラリをどのように組み込んでいるか、競合にどのように対処しているかを教えてください。
私は Ember 1.0pre1 と、わずかに変更されたバージョンの Ember-rest を使用しています。