OpsWorks isn\'t precompiling assets on deploy. I found this recipe in this thread but I think it\'s not complete though, or missing something because I get an error about
Note that if you're passing environment variables to your Rails app using the new OpsWorks feature, you'll need to include these variables in your rake
invocation (as they don't get permanently sourced into the deploy user's environment).
I do the following (based on this article and this recipe) in deploy/before_migrate.rb
:
Chef::Log.info("Precompiling assets for RAILS_ENV=" \
"#{new_resource.environment['RAILS_ENV']}...")
execute 'rake assets:precompile' do
cwd release_path
command 'bundle exec rake assets:precompile'
environment new_resource.environment
end