我在这个惊人的article中读到了我应该通过向:assets
组添加宝石来保存我的内存。
所以我试着这样做:
group :assets do
gem 'sass-rails'
gem 'coffee-rails', '~> 3.2.1'
gem 'coffee-script-source', '1.5.0'
gem 'uglifier', '>= 1.0.3'
# Front-end
gem 'jquery-rails'
gem 'bootstrap-sass'
end
但是当我推送到heroku时,我得到了这个错误:
Sprockets::FileNotFound in Me#index
Showing /app/app/views/layouts/application.html.haml where line #58 raised:
couldn't find file 'jquery'
(in /app/app/assets/javascripts/libs/libs.js:4)
Extracted source (around line #58):
55:
56: / %script{src: "//api.tiles.mapbox.com/mapbox.js/v1.4.0/mapbox.js"}
57:
58: = javascript_include_tag 'libs/libs'
59: %script{:src => "http://js.pusher.com/2.1/pusher.min.js", :type => "text/javascript"}
60: %script{:src => "//cdn.jsdelivr.net/modernizr/2.7.1/modernizr.min.js", :type => "text/javascript"}
61: %script{:src => "//cdn.jsdelivr.net/webshim/1.11.0/polyfiller.js", :type => "text/javascript"}
我读here这是正常的,因为:资产意味着很多:开发+:测试
我如何告诉Heroku我希望在资源预编译时加载一个特定的gem,但不再在运行时加载?
我使用Rails 3.2。
感谢您的支持