2013-12-13 27 views
0

這是我在Heroku上的應用程序:http://mighty-brushlands-6367.herokuapp.com/,這是它應該是什麼樣子的,因爲它確實在本地:的jQuery/JavaScript的運行在本地而不是在Heroku

enter image description here

嗯,我做了一些谷歌搜索。我檢查這個解決方案:JQuery events are not working on heroku in production but work in development和其他。

我繼續運行heroku run rake assets:precompile,但仍無法獲得Heroku的效果。這就是我的application.js的樣子:

// This is a manifest file that'll be compiled into application.js, which will include all the files 
// listed below. 
// 
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 
// 
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 
// compiled file. 
// 
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details 
// about supported directives. 
// 
//= require jquery 
//= require jquery_ujs 
//= require turbolinks 
//= require_tree . 
//= require bootstrap 
//= require textEffect 

我需要一些指導。我是一個渴望知識的新手。

回答

0

解決的辦法是增加

group :production, :staging do 
    gem 'rails_12factor' 
end 

到Gemfile中,並再次承諾的Heroku

0

您的Heroku應用程序在application.js & application.css文件中出現404錯誤,這導致我相信它並未首先被推送到Heroku。

嘗試運行rake assets:precompile開發中,然後通常步驟git add .,然後git commit,然後git push

相關問題