2013-03-11 60 views
0

我將在我的Rails應用程序 「audiojs」 音樂播放器(http://kolber.github.com/audiojs/的Heroku - ::的ActionView ::模板錯誤

在本地主機上的所有良好和工作,但是Heroku的說:

"We're sorry, but something went wrong." 

日誌

ActionView::Template::Error (audiojs/audio.min.js isn't precompiled) 

如何解決問題?

+0

可能是因爲您的資產未能正確預編譯。看看你的日誌和這個幫助文檔:https://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar – 2013-03-11 22:23:19

+0

新錯誤 ActionController :: RoutingError(沒有路由匹配[GET]「/ undefinedplayer- 「): – technobot 2013-03-12 11:58:02

+0

上次登錄http://old.pastie.org/6459850 幫我看看! – technobot 2013-03-12 12:21:01

回答

0

問題出在您的主頁javascript。您正在嘗試加載曲目,但您要查找的元素不存在,因此您會收到未定義的錯誤。

var audio = a[0]; 
first = $('ol a').attr('data-src'); 

// Add this code to layouts/application.html.erb 
// First is coming back undefined on your root route. 
if (first == undefined) 
    console.log("First is undefined! Will cause error in audio track"); 

$('ol li').first().addClass('playing'); 
audio.load(first); 

然而,你設置在releases/show.html.erb(和index.html.erbdata-src="<%= show.preview %>"和代碼工作沒有問題存在。

您的選擇是檢測是否沒有訂單項目,並且不會嘗試自動播放音軌或將音軌添加到您的主頁面。

+0

哦,隊友。我愚蠢。只需要添加: 寶石「audiojs」。 然後在application.js中添加// =需要audiojs並且沒有問題。 thx給你時間和支持! 愛! – technobot 2013-03-20 17:27:43

+0

@technobot很高興我可以幫忙! – 2013-03-20 17:32:47

相關問題