我新建了一个项目,然后安装了 mina,版本是 1.2.3 的,在 deploy.rb 里面设置了如下参数
set :application_name, 'rails_deploy'
set :domain, 'ubuntu@u1c2g'
set :deploy_to, '/var/www/rails_deploy'
set :repository, 'https://github.com/jiyarong/rails-deploy.git'
set :branch, 'master'
ruby_version = "2.3.1"
task :remote_environment do
invoke :"rvm:use", ruby_version
end
其他的都没改,都是默认设置,这样子mina setup
mina deploy
是没问题的
但是我想在 shared_path 里面再继续加入config
里面的若干文件
set :shared_dirs, fetch(:shared_dirs, []).push('config')
set :shared_files, fetch(:shared_files, []).push('config/database.yml', 'config/secrets.yml', 'config/application.rb')
这样子跑deploy
就会报错
Creating database
rake aborted!
LoadError: cannot load such file -- /var/www/rails_deploy/tmp/build-152143332714966/config/application
/var/www/rails_deploy/tmp/build-152143332714966/Rakefile:4:in `require_relative'
/var/www/rails_deploy/tmp/build-152143332714966/Rakefile:4:in `<top (required)>'
/var/www/rails_deploy/tmp/build-152143332714966/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `load'
/home/ubuntu/.rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in `kernel_load'
/home/ubuntu/.rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:28:in `run'
/home/ubuntu/.rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/cli.rb:424:in `exec'
/home/ubuntu/.rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/ubuntu/.rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/ubuntu/.rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/home/ubuntu/.rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/cli.rb:27:in `dispatch'
/home/ubuntu/.rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/home/ubuntu/.rvm/gems/ruby-2.3.1/gems/bundler-1.16.1/lib/bundler/cli.rb:18:in `start'
Connection to u1c2g closed.