• 能翻译下就更好了

  • 我也遇到同样的问题,但是我的staging静态资源配置和你配置的一样,使用mina部署时第一次访问还是很慢

  • Capistrano 部署问题 at 2018年10月27日
    before "deploy:assets:precompile", "deploy:yarn_install"
    
    namespace :deploy do
      desc "Make sure local git is in sync with remote."
      task :check_revision do
        on roles(:app) do
          unless `git rev-parse HEAD` == `git rev-parse origin/erp_production`
            puts "WARNING: HEAD is not the same as origin/erp_production"
            puts "Run `git push` to sync changes."
            exit
          end
        end
      end
      desc 'Run rake yarn:install'
      task :yarn_install do
        on roles(:app) do
          within release_path do
            execute("cd #{release_path} && yarn install")
          end
        end
      end
      desc 'Initial Deploy'
      task :initial do
        on roles(:app) do
          before 'deploy:restart', 'puma:start'
          invoke 'deploy'
        end
      end
    
      desc 'Restart application'
      task :restart do
        on roles(:app), in: :sequence, wait: 5 do
          invoke 'puma:restart'
        end
      end
    
      desc "Create linked_files"
      task :setup do
        on roles(:app) do
          execute "touch #{shared_path}/config/database.yml"
          execute "touch #{shared_path}/config/master.key"
          execute "touch #{shared_path}/config/webpacker.yml"
        end
      end
    
    
      before :starting, :check_revision
      after :finishing, :compile_assets
      after :finishing, :cleanup
      after :finishing, :restart
    end
    

    使用cap production deploy 一直提示webpack 无法 install

  • Capistrano 部署问题 at 2018年10月27日

    用的是rbenv,好的,我试下。谢谢

  • Capistrano 部署问题 at 2018年10月26日

    capfile配置

    # Load DSL and set up stages
    require "capistrano/setup"
    
    # Include default deployment tasks
    require "capistrano/deploy"
    
    # Load the SCM plugin appropriate to your project:
    #
    # require "capistrano/scm/hg"
    # install_plugin Capistrano::SCM::Hg
    # or
    # require "capistrano/scm/svn"
    # install_plugin Capistrano::SCM::Svn
    # or
    require "capistrano/scm/git"
    install_plugin Capistrano::SCM::Git
    
    # Include tasks from other gems included in your Gemfile
    #
    # For documentation on these, see for example:
    #
    #   https://github.com/capistrano/rvm
    #   https://github.com/capistrano/rbenv
    #   https://github.com/capistrano/chruby
    #   https://github.com/capistrano/bundler
    #   https://github.com/capistrano/rails
    #   https://github.com/capistrano/passenger
    #
    require "capistrano/rvm"
    require "capistrano/rbenv"
    # require "capistrano/chruby"
    require "capistrano/bundler"
    require "capistrano/rails/assets"
    require "capistrano/rails/migrations"
    # require "capistrano/passenger"
    require 'capistrano/puma'
    # require 'capistrano/sidekiq'
    # require 'capistrano/sidekiq/monit'
    
    # Load custom tasks from `lib/capistrano/tasks` if you have any defined
    
    
    Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
    ```ruby
    
     执行cap production deploy
    ```shell
        12 chuck@ys1.youtulink.com 0.076s
          13 ln -s /home/chuck/youerp_production/shared/public/storage /home/chuck/youerp_production/releases/20181026102931/public/storage
        ✔ 13 chuck@ys1.youtulink.com 0.078s
    00:07 bundler:install
          01 $HOME/.rbenv/bin/rbenv exec ~/.rvm/bin/rvm default do bundle install --path /home/chuck/youerp_production/shared/bundle --without development test --deployment
          01 rbenv: /home/chuck/.rvm/bin/rvm: command not found
          01
    #<Thread:0x000055778c9ef828@/home/taotao/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.18.0/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
    Traceback (most recent call last):
        1: from /home/taotao/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.18.0/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
    /home/taotao/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.18.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing on host ys1.youtulink.com: bundle exit status: 127 (SSHKit::Runner::ExecuteError)
    bundle stdout: rbenv: /home/chuck/.rvm/bin/rvm: command not found
    bundle stderr: Nothing written
    (Backtrace restricted to imported tasks)
    cap aborted!
    SSHKit::Runner::ExecuteError: Exception while executing on host ys1.youtulink.com: bundle exit status: 127
    bundle stdout: rbenv: /home/chuck/.rvm/bin/rvm: command not found
    bundle stderr: Nothing written
    
    
    Caused by:
    SSHKit::Command::Failed: bundle exit status: 127
    bundle stdout: rbenv: /home/chuck/.rvm/bin/rvm: command not found
    bundle stderr: Nothing written
    
    Tasks: TOP => deploy:updated => bundler:install
    (See full trace by running task with --trace)
    The deploy has failed with an error: Exception while executing on host ys1.youtulink.com: bundle exit status: 127
    bundle stdout: rbenv: /home/chuck/.rvm/bin/rvm: command not found
    bundle stderr: Nothing written
    
    
    ** DEPLOY FAILED
    ** Refer to log/capistrano.log for details. Here are the last 20 lines:
    
    
    

    不知道什么原因

  • Capistrano 部署问题 at 2018年10月26日

    无法bundle install

  • Rails 管理多数据库 at 2018年08月29日

    谢谢您的分享。这个gem我看过。之前一直没有用过这个包,最近也在学习这个包

  • Rails 管理多数据库 at 2018年08月28日

    谢谢分享,我们这个小型项目。是没有做前后端分离的。我之前也是通过分支管理。但现在维护起来不容易。每个分支都需要单独去维护

  • Rails 管理多数据库 at 2018年08月28日

    谢谢分享

  • 其实在日常开发中很多开发者工作都是以实现功能为主,很多东西只知道怎么用,但是为什么要这样用。其实这个和工作经验有关。只有慢慢的积累经验。很多东西才会明白