2013-08-19 167 views

回答

2

首先,您不需要同时使用[]%w()。尽量只:

config.assets.precompile += %w(application_admin.css) 

这是等价的:

config.assets.precompile += ['application_admin.css'] 

其次,因为你是预编译为您生产环境中,你要运行:

RAILS_ENV=production bundle exec rake assets:precompile 

刚:

bundle exec rake assets:precompile 

默认为您的开发环境运行它。你会希望在你想预先编制你的资产的每个环境中运行这个。

+0

没有没有做任何事情。 “$束EXEC耙资产:预编译 $” – nevermind

+0

@Newbie,既然你把它放在你的production.rb文件你可能想要做一个: 'RAILS_ENV =产品包的exec耙资产:precompile' –

+0

是的,这工作!改变解决方案以包括环境,我会接受它。我们是否也运行bundle exec rake资源:分别为每个环境预编译? – nevermind