In capistrano 2 I could specify this in my deploy.rb and my assets would be precompiled properly (my app is deployed under a sub-uri)
set :asset_env, "#{asset_env} RAILS_RELATIVE_URL_ROOT=/#{application}"
in capistrano 3 how do I do this? The below does not seem to work... it never gets passed to the rake task like it did in cap 2.
set :asset_env, "#{fetch(:asset_env)} RAILS_RELATIVE_URL_ROOT=/#{fetch(:application)}"
# Capistrano 2.0.x
task :precompile, :roles => lambda { assets_role }, :except => { :no_release => true } do
run <<-CMD.compact
cd -- #{latest_release} &&
RAILS_ENV=#{rails_env.to_s.shellescape} #{asset_env} #{rake} assets:precompile
CMD
end
is now like this in cap 3
# Capistrano 3.0.x
task :precompile do
on :sprockets_asset_host, reject: lambda { |h| h.properties.no_release } do
within fetch(:latest_release_directory)
with rails_env: fetch(:rails_env) do
execute :rake, 'assets:precompile'
end
end
end
end
which as you can see, the execute :rake doesn't seem to include the asset_env like it did in cap 2.... ????