Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/61.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 cap deploy:冷时找不到bash:bundle:命令错误_Ruby On Rails_Bash_Nginx_Rvm_Rvm Capistrano - Fatal编程技术网

Ruby on rails cap deploy:冷时找不到bash:bundle:命令错误

Ruby on rails cap deploy:冷时找不到bash:bundle:命令错误,ruby-on-rails,bash,nginx,rvm,rvm-capistrano,Ruby On Rails,Bash,Nginx,Rvm,Rvm Capistrano,我正在使用部署,但我没有创建新用户,而是继续使用根用户。我用独角兽,nginx,capistrano来做这个。 运行cap deploy:cold时,我收到错误bash:bundle:command未找到 deploy.rb set :stages, %w(production) #various environments require "bundler/capistrano" require "rvm/capistrano" server "xxx.xxx.xxx.xx", :web, :

我正在使用部署,但我没有创建新用户,而是继续使用根用户。我用独角兽,nginx,capistrano来做这个。 运行
cap deploy:cold
时,我收到错误
bash:bundle:command未找到

deploy.rb

set :stages, %w(production) #various environments
require "bundler/capistrano"
require "rvm/capistrano"

server "xxx.xxx.xxx.xx", :web, :app, :db, primary: true

set :application, "xyz"
set :stage, "production"
set :user, "root"
set :port, 22
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
set :default_shell, :bash

# set :scm, "git"
set :repository, "git@bitbucket.org:xyz_app/xyz.git"
set :branch, "master"

# set :rvm_ruby_string, :local     # use the same ruby as used locally for deployment
set :rvm_autolibs_flag, "read-only"       # more info: rvm help autolibs

before 'deploy:setup', 'rvm:install_rvm'  # install/update RVM
# before 'deploy:setup', 'rvm:install_ruby'

# before 'deploy:setup', 'rvm:install_ruby' # install Ruby and create gemset,


default_run_options[:pty] = true
ssh_options[:forward_agent] = true

after "deploy", "deploy:cleanup" # keep only the last 5 releases

namespace :deploy do
  %w[start stop restart].each do |command|
    desc "#{command} unicorn server"
    task command, roles: :app, except: {no_release: true} do
     run "/etc/init.d/unicorn_#{application} #{command}"
    end
  end
  task :setup_config, roles: :app do
    sudo "ln -nfs #{current_path}/config/nginx.conf /etc/nginx/sites-enabled/#{application}"
    sudo "ln -nfs #{current_path}/config/unicorn_init.sh /etc/init.d/unicorn_#{application}"
    run "mkdir -p #{shared_path}/config"
    put File.read("config/database.example.yml"), "#{shared_path}/config/database.yml"
    puts "Now edit the config files in #{shared_path}."
  end
  after "deploy:setup", "deploy:setup_config" 
  task :symlink_config, roles: :app do
    run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
  end
  after "deploy:finalize_update", "deploy:symlink_config"
  desc "Make sure local git is in sync with remote."
  task :check_revision, roles: :web do
    unless `git rev-parse HEAD` == `git rev-parse origin/master`
    puts "WARNING: HEAD is not the same as origin/master"
    puts "Run `git push` to sync changes."
  exit
 end
end
before "deploy", "deploy:check_revision"
end
帽壳输出

cap> echo $PATH
[establishing connection(s) to xxx.xxx.xxx.xx]
** [out :: xxx.xxx.xxx.xx] /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/root/.rvm/bin
** [out :: xxx.xxx.xxx.xx] 
cap> id
** [out :: xxx.xxx.xxx.xx] uid=0(root) gid=0(root) groups=0(root)
** [out :: xxx.xxx.xxx.xx] 
cap> exit
cap部署:检查

You appear to have all necessary dependencies installed
错误代码

* 2015-09-10 01:49:10 executing `bundle:install'
* executing "cd /home/root/apps/xyz/releases/20150909201909 && bundle install --gemfile /home/root/apps/xyz/releases/20150909201909/Gemfile --path /home/root/apps/xyz/shared/bundle --deployment --quiet --without development test"
servers: ["xxx.xxx.xxx.xx"]
[xxx.xxx.xxx.xx] executing command
** [out :: xxx.xxx.xxx.xx] bash: bundle: command not found
** [out :: xxx.xxx.xxx.xx] 
command finished in 338ms
*** [deploy:update_code] rolling back
请帮我解决这个问题。提前感谢

您需要bundler

这泄露了它:
bash:bundle:command未找到

gem install bundler