Gourav
Gourav

Reputation: 13

Assets Precompile Capistrano 3.4

I am a newbie in deploying,

Using capistrano 3.4 for deploying

I am trying to deploy for staging environment, using this task for precompile

desc "assets precompile"
  task :precompile do
    on roles(:rails) do
      execute "cd #{release_path} && bundle exec rake assets:precompile RAILS_ENV=#{fetch(:stage)} "
    end
  end
  after :publishing, :precompile

But precompile is getting freeze not moving, if i uncomment these above task and deploy then it gets deployed but assets are not loading.

Please help how to proceed

Upvotes: 0

Views: 647

Answers (1)

Dinesh Goyal
Dinesh Goyal

Reputation: 127

No need to write manual task for asset precomplie.There is nice gem available for it.

Include gem 'capistrano-rails' in Gemfile.

and add require 'capistrano/rails/assets' in capfile.

Thanks..!!

Upvotes: 3

Related Questions