上限部署后删除了ckeditor资产

时间:2013-11-26 12:52:48

标签: ruby-on-rails deployment capistrano

我使用过Rails 4.0.0,

上限部署后,ckeditor资产将从服务器中删除。

任何人都可以帮忙。

这些是 deploy.rb

中的代码
# if you want to clean up old releases on each deploy uncomment this:
after "deploy:restart", "deploy:cleanup", 'deploy:update_crontab'



namespace :deploy do
  task :start, :roles => :app do
    run "touch #{current_path}/tmp/restart.txt"
  end

  task :stop, :roles => :app do
    # Do nothing.
  end

  desc "Restart Application"
  task :restart, :roles => :app do
    run "touch #{current_path}/tmp/restart.txt"
  end

  after 'deploy:update_code' do
    #run "cd #{release_path}; RAILS_ENV=production rake db:create"

    run "cd #{release_path}; RAILS_ENV=production rake db:migrate"
    run "cd #{release_path}; RAILS_ENV=production rake db:seed"
    run "cd #{release_path}; RAILS_ENV=production rake assets:precompile"

    run "ln -s #{shared_path}/public/ckeditor_assets #{release_path}/public/ckeditor_assets"

  end

  desc "Update the crontab file"
  task :update_crontab, :roles => :db do
    run "cd #{release_path} && whenever --update-crontab #{application}"
    run "cd #{release_path}; tail -f log/cron_log.log"
  end

1 个答案:

答案 0 :(得分:2)

这是因为文件存储在应用程序文件夹(公共)中,您需要移动到共享。

您有两种选择: - 制作一个附件,将符号链接文件进行分享 - 将您的文件夹包含在共享

您可以在此处查看此步骤:Carrierwave files with Capistrano