我没有使用SASS或coffeescript但是我为less-rails-bootstrap gem包含了更少的rails。 我的application.css文件如下所示:
*= require_self
*= require twitter/bootstrap
*= require twitter/bootstrap-responsive
*= require_tree .
*/
在开发模式下,require_tree中的所有文件。加入,但是当我切换到生产并运行rake资产:预编译时,生成的聚合application.js文件只包含来自self和bootstraps所需的代码,所有来自require_tree的文件都将被忽略。
我也试过了:
RAILS_ENV=production bundle exec rake assets:precompile
我的production.rb文件看起来正确,我在application.rb文件中有以下内容:
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
end
我真的在这里转动轮子。我错过了什么吗?