-1

随着资产组的删除。生产模式下是否需要 Javascript 引擎?我的意思是,我不想在生产服务器中安装 Javascript 引擎。

我将使用需要咖啡轨的 Turbolinks,我想它需要一个 Javascript 引擎,对吗?

4

1 回答 1

0

您的config/application.rb文件中是否有这些行(在所有require行之后):

if defined?(Bundler)
  # If you precompile assets before deploying to production, use this line
  Bundler.require(*Rails.groups(:assets => %w(development test)))
  # If you want your assets lazily compiled in production, use this line
  # Bundler.require(:default, :assets, Rails.env)
end

然后您可以将您的资产类型的东西(咖啡轨和 sass-rails 等)放入development组中,并且在生产中不需要它。

您还可以查看此 SO 答案,以解释为什么assets专门删除了组:

为什么 Rails4 放弃了对 Gemfile 中“资产”组的支持

于 2013-09-11T21:29:07.660 回答