これは Rails 3.1 の既知の問題で、Rails 3.2 で修正されたと思われます。ここで別の言及も見ています。Rails 3.1 と Spree 1.0 の新規インストールで同じ問題に遭遇し、他の依存関係はありませんでした。
これが私がそれを回避した方法です:
Capfile で、これをコメントアウトします。
load 'deploy/assets'
私のdeploy.rb
ファイルではdeploy/assets
、 spree-rails gem で提供されているものをコピーしましたが、precompile_quick
タスクを追加しました。これは CSS と JS をコンパイルしますが、実際には CSS と JS を圧縮していないようです。
before 'deploy:finalize_update', 'deploy:assets:symlink'
after 'deploy:update_code', 'deploy:assets:precompile_quick'
namespace :deploy do
namespace :assets do
desc <<-DESC
[internal] This task will set up a symlink to the shared directory \
for the assets directory. Assets are shared across deploys to avoid \
mid-deploy mismatches between old application html asking for assets \
and getting a 404 file not found error. The assets cache is shared \
for efficiency. If you cutomize the assets path prefix, override the \
:assets_prefix variable to match.
DESC
task :symlink, :roles => assets_role, :except => { :no_release => true } do
run <<-CMD
rm -rf #{latest_release}/public/#{assets_prefix} &&
mkdir -p #{latest_release}/public &&
mkdir -p #{shared_path}/assets &&
ln -s #{shared_path}/assets #{latest_release}/public/#{assets_prefix}
CMD
end
desc <<-DESC
Run the asset precompilation rake task. You can specify the full path \
to the rake executable by setting the rake variable. You can also \
specify additional environment variables to pass to rake via the \
asset_env variable. The defaults are:
set :rake, "rake"
set :rails_env, "production"
set :asset_env, "RAILS_GROUPS=assets"
DESC
task :precompile_quick, :roles => assets_role, :except => { :no_release => true } do
run "cd #{current_path} ; RAILS_ENV=#{rails_env} bundle exec rake assets:precompile:primary"
run "cd #{current_path} ; RAILS_ENV=#{rails_env} bundle exec rake assets:precompile:nondigest"
end
desc <<-DESC
Run the asset clean rake task. Use with caution, this will delete \
all of your compiled assets. You can specify the full path \
to the rake executable by setting the rake variable. You can also \
specify additional environment variables to pass to rake via the \
asset_env variable. The defaults are:
set :rake, "rake"
set :rails_env, "production"
set :asset_env, "RAILS_GROUPS=assets"
DESC
task :clean, :roles => assets_role, :except => { :no_release => true } do
run "cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:clean"
end
end
end