【问题标题】:How can I create new symlink for RoR Application in the public_html folder?如何在 public_html 文件夹中为 RoR 应用程序创建新的符号链接?
【发布时间】:2010-02-10 11:25:49
【问题描述】:

我在 public_html 文件夹中有一个名为 techease 的文件夹,我希望我的应用程序符号链接到这个现有文件夹,我该怎么做?

因为当我将它与此文件夹链接时,它将在 techease 文件夹中创建公用文件夹,然后与该文件夹进行符号链接。

如何使用现有文件夹而不是新创建的文件夹创建符号链接如果我删除 techease 文件夹并创建符号链接,那么它可以正常工作,但是当该文件夹已经存在时,它将无法工作。

请帮我解决这个问题。

谢谢

【问题讨论】:

    标签: ruby-on-rails ruby


    【解决方案1】:

    执行此操作的地方来自您的 Capistrano 食谱。您可以创建一个在部署后自动创建符号链接的新任务。它看起来像这样(您必须根据您的情况更新路径):

    after :deploy, 'deploy:link_dependencies'
    
    namespace :deploy do
      desc <<-DESC
        Creates symbolic links to configuration files and other dependencies after deployment.
      DESC
      task :link_dependencies, :roles => :app do
        run "ln -nfs #{shared_path}/public/techease #{release_path}/public/techease"
      end
    end
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-05-26
      • 1970-01-01
      • 1970-01-01
      • 2013-04-22
      • 2018-08-17
      • 2023-03-12
      • 1970-01-01
      相关资源
      最近更新 更多