3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

capistranoとprecompileされていないjs

Posted at

※ やんごとなき理由により、現在precompile済みのjsとprecompileされたjsが/public/assets/以下で共存しています。

capistranoでデプロイすると、もともとpublic/assets内にあったjsが無くなってしまうので以下のようにして対応しました。

rb/deploy.rb
set :deploy_via, :remote_cache
...
namespace :customs do
  task :symlink, :roles => :app do
    # public/assets直下のディレクトリをリンクする
    ['images', 'javascripts', 'stylesheets'].each{ |dir|
      run "ln -nfs #{shared_path}/cached-copy/public/assets/#{dir} #{current_path}/public/assets/#{dir}"
    }
  end
end
after "deploy:symlink", "customs:symlink"
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?