Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Mina部署can';我找不到包裹_Ruby On Rails_Ruby_Deployment - Fatal编程技术网

Ruby on rails Mina部署can';我找不到包裹

Ruby on rails Mina部署can';我找不到包裹,ruby-on-rails,ruby,deployment,Ruby On Rails,Ruby,Deployment,首次使用RubyonRails应用程序尝试Mina,但在以root用户身份部署时,似乎看不到Bundler 我使用Digital Ocean作为远程服务器 如果我以同一根用户的身份SSH到远程服务器,捆绑包运行正常。Git克隆工作正常,文件结构是通过:setup设置的,其他一切似乎都很好 部署使用的是“root”用户,是的,我最终将更改为另一个用户 这是我的deploy.rb require 'mina/bundler' require 'mina/rails' require 'mina/gi

首次使用RubyonRails应用程序尝试Mina,但在以root用户身份部署时,似乎看不到Bundler

我使用Digital Ocean作为远程服务器

如果我以同一根用户的身份SSH到远程服务器,捆绑包运行正常。Git克隆工作正常,文件结构是通过:setup设置的,其他一切似乎都很好

部署使用的是“root”用户,是的,我最终将更改为另一个用户

这是我的deploy.rb

require 'mina/bundler'
require 'mina/rails'
require 'mina/git'

set :domain, 'example.com'
set :deploy_to, '/var/www/example.com'
set :repository, 'git@git.example.co:example.git'
set :branch, 'digital_ocean'
set :shared_paths, ['log']

# Optional settings:
set :user, 'root'    # Username in the server to SSH to.

task :setup => :environment do
  ... *standard code removed*
end

desc "Deploys the current version to the server."
task :deploy => :environment do
  to :before_hook do
    # Put things to run locally before ssh
  end
  deploy do
    # Put things that will set up an empty directory into a fully set-up
    # instance of your project.
    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    invoke :'bundle:install'
    invoke :'rails:db_migrate'
    invoke :'rails:assets_precompile'
    invoke :'deploy:cleanup'

    to :launch do
      queue "mkdir -p #{deploy_to}/#{current_path}/tmp/"
      queue "touch #{deploy_to}/#{current_path}/tmp/restart.txt"
    end
  end
end
这是“mina deploy--verbose”的--verbose输出:

-----> Creating a temporary build path
   $ touch "deploy.lock" 
   $ mkdir -p "$build_path" 
   $ cd "$build_path" 

-----> Fetching new git commits
   $ (cd "/var/www/example.com/scm" && git fetch "git@git.example.co:example.git" "digital_ocean:digital_ocean" --force) 
   -----> Using git branch       Cloning into '.'...

-----> Using git branch 'digital_ocean'
   done.
   $ git clone "/var/www/example.com/scm" . --recursive --branch "digital_ocean" 

-----> Using this git commit

   $ git rev-parse HEAD > .mina_git_revision 
   $ git --no-pager log --format='%aN (%h):%n> %s' -n 1 
   Carson Cole (e932114): 
   > removed gemfile.lock 
   $ rm -rf .git 


-----> Symlinking shared paths
   $ mkdir -p "." 
   $ rm -rf "./log" 
   bash: line 93: bundle: command not found
   $ ln -s "/var/www/example.com/shared/log" "./log" 

-----> Installing gem dependencies using Bundler
   $ mkdir -p "/var/www/example.com/shared/bundle" 
   $ mkdir -p "./vendor" 
   $ ln -s "/var/www/example.com/shared/bundle" "./vendor/bundle" 
   $ bundle install --without development:test --path "./vendor/bundle" --deployment 
!     ERROR: Deploy failed.   

-----> Cleaning up build
   $ rm -rf "$build_path" 
   Unlinking current 
   $ rm -f "deploy.lock" 
   OK 

!     Command failed.
   Failed with status 1 (19)

假设绑定器安装在您的服务器上,若在路径中找不到它,则必须安装

set :bundle_bin, "/path/to/bundle"

mina设置
适合我