cap deploy + rbenv:捆绑:找不到命令
cap deploy + rbenv: bundle: command not found
我关注https://gorails.com/deploy/ubuntu/16.04
我是 运行 : "bundle exec cap production deploy"
并收到以下错误:
✔ 10 deploy@107.170.84.18 0.289s
00:21 bundler:install
01 $HOME/.rbenv/bin/rbenv exec bundle install --path /home/deploy/deploy_test1/shared/bundle --without development test --deployment --q…
01 rbenv: bundle: command not found
01
01 The `bundle' command exists in these Ruby versions:
01 2.4.0
01
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@107.170.84.18: bundle exit status: 127
bundle stdout: Nothing written
bundle stderr: rbenv: bundle: command not found
The `bundle' command exists in these Ruby versions:
2.4.0
SSHKit::Command::Failed: bundle exit status: 127
bundle stdout: Nothing written
bundle stderr: rbenv: bundle: command not found
The `bundle' command exists in these Ruby versions:
2.4.0
Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as deploy@107.170.84.18: bundle exit status: 127
bundle stdout: Nothing written
bundle stderr: rbenv: bundle: command not found
The `bundle' command exists in these Ruby versions:
2.4.0
** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:
DEBUG [3de26178] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.3.1" ; /usr/bin/env ln -s /home/deploy/deploy_test1/shared/public/assets /home/deploy/deploy_test1/releases/20170509194018/public/assets )
INFO [3de26178] Finished in 0.289 seconds with exit status 0 (successful).
DEBUG [25920183] Running if test ! -d /home/deploy/deploy_test1/releases/20170509194018; then echo "Directory does not exist '/home/deploy/deploy_test1/releases/20170509194018'" 1>&2; false; fi as deploy@107.170.84.18
DEBUG [25920183] Command: if test ! -d /home/deploy/deploy_test1/releases/20170509194018; then echo "Directory does not exist '/home/deploy/deploy_test1/releases/20170509194018'" 1>&2; false; fi
DEBUG [25920183] Finished in 0.291 seconds with exit status 0 (successful).
DEBUG [7b4c3ff7] Running $HOME/.rbenv/bin/rbenv exec bundle check --path /home/deploy/deploy_test1/shared/bundle as deploy@107.170.84.18
DEBUG [7b4c3ff7] Command: cd /home/deploy/deploy_test1/releases/20170509194018 && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.3.1" ; $HOME/.rbenv/bin/rbenv exec bundle check --path /home/deploy/deploy_test1/shared/bundle )
DEBUG [7b4c3ff7] rbenv: bundle: command not found
DEBUG [7b4c3ff7]
The `bundle' command exists in these Ruby versions:
DEBUG [7b4c3ff7] 2.4.0
DEBUG [7b4c3ff7]
DEBUG [7b4c3ff7] Finished in 0.399 seconds with exit status 127 (failed).
INFO [3bbf2dfd] Running $HOME/.rbenv/bin/rbenv exec bundle install --path /home/deploy/deploy_test1/shared/bundle --without development test --deployment --quiet as deploy@107.170.84.18
DEBUG [3bbf2dfd] Command: cd /home/deploy/deploy_test1/releases/20170509194018 && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.3.1" ; $HOME/.rbenv/bin/rbenv exec bundle install --path /home/deploy/deploy_test1/shared/bundle --without development test --deployment --quiet )
DEBUG [3bbf2dfd] rbenv: bundle: command not found
DEBUG [3bbf2dfd]
The `bundle' command exists in these Ruby versions:
DEBUG [3bbf2dfd] 2.4.0
DEBUG [3bbf2dfd]
"gem list" 在两台机器上显示 : bundler (1.14.6),在我的生产机器和服务器上显示 ruby 2.4.0。
如何进行?
我正在发布我的 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
# If you are using rbenv add these lines:
require 'capistrano/rbenv'
set :rbenv_type, :user
set :rbenv_ruby, '2.3.1'
require 'capistrano/bundler'
require 'capistrano/rails'
require 'capistrano/passenger'
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
我的deploy.rb:
# config valid only for current version of Capistrano
lock "3.8.1"
set :application, "deploy_test1"
set :repo_url, "git@bitbucket.org:confidentialname/deploy_test1.git"
set :deploy_to, '/home/deploy/deploy_test1'
#append :linked_files, "config/database.yml", "config/secrets.yml"
append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "vendor/bundle", "public/system", "public/uploads"
看起来 rbenv
设置为 运行 Ruby 2.3.1。您在日志中的多个位置 RBENV_VERSION="2.3.1"
。根据 the rbenv documentation,您可以找到 rbenv version
是如何设置的。如果你想测试 Ruby 2.4.0,你需要指向那个版本。或者,如果您真的想在 2.3.1 上 运行,则需要安装捆绑器。
我关注https://gorails.com/deploy/ubuntu/16.04
我是 运行 : "bundle exec cap production deploy" 并收到以下错误:
✔ 10 deploy@107.170.84.18 0.289s
00:21 bundler:install
01 $HOME/.rbenv/bin/rbenv exec bundle install --path /home/deploy/deploy_test1/shared/bundle --without development test --deployment --q…
01 rbenv: bundle: command not found
01
01 The `bundle' command exists in these Ruby versions:
01 2.4.0
01
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@107.170.84.18: bundle exit status: 127
bundle stdout: Nothing written
bundle stderr: rbenv: bundle: command not found
The `bundle' command exists in these Ruby versions:
2.4.0
SSHKit::Command::Failed: bundle exit status: 127
bundle stdout: Nothing written
bundle stderr: rbenv: bundle: command not found
The `bundle' command exists in these Ruby versions:
2.4.0
Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as deploy@107.170.84.18: bundle exit status: 127
bundle stdout: Nothing written
bundle stderr: rbenv: bundle: command not found
The `bundle' command exists in these Ruby versions:
2.4.0
** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:
DEBUG [3de26178] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.3.1" ; /usr/bin/env ln -s /home/deploy/deploy_test1/shared/public/assets /home/deploy/deploy_test1/releases/20170509194018/public/assets )
INFO [3de26178] Finished in 0.289 seconds with exit status 0 (successful).
DEBUG [25920183] Running if test ! -d /home/deploy/deploy_test1/releases/20170509194018; then echo "Directory does not exist '/home/deploy/deploy_test1/releases/20170509194018'" 1>&2; false; fi as deploy@107.170.84.18
DEBUG [25920183] Command: if test ! -d /home/deploy/deploy_test1/releases/20170509194018; then echo "Directory does not exist '/home/deploy/deploy_test1/releases/20170509194018'" 1>&2; false; fi
DEBUG [25920183] Finished in 0.291 seconds with exit status 0 (successful).
DEBUG [7b4c3ff7] Running $HOME/.rbenv/bin/rbenv exec bundle check --path /home/deploy/deploy_test1/shared/bundle as deploy@107.170.84.18
DEBUG [7b4c3ff7] Command: cd /home/deploy/deploy_test1/releases/20170509194018 && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.3.1" ; $HOME/.rbenv/bin/rbenv exec bundle check --path /home/deploy/deploy_test1/shared/bundle )
DEBUG [7b4c3ff7] rbenv: bundle: command not found
DEBUG [7b4c3ff7]
The `bundle' command exists in these Ruby versions:
DEBUG [7b4c3ff7] 2.4.0
DEBUG [7b4c3ff7]
DEBUG [7b4c3ff7] Finished in 0.399 seconds with exit status 127 (failed).
INFO [3bbf2dfd] Running $HOME/.rbenv/bin/rbenv exec bundle install --path /home/deploy/deploy_test1/shared/bundle --without development test --deployment --quiet as deploy@107.170.84.18
DEBUG [3bbf2dfd] Command: cd /home/deploy/deploy_test1/releases/20170509194018 && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.3.1" ; $HOME/.rbenv/bin/rbenv exec bundle install --path /home/deploy/deploy_test1/shared/bundle --without development test --deployment --quiet )
DEBUG [3bbf2dfd] rbenv: bundle: command not found
DEBUG [3bbf2dfd]
The `bundle' command exists in these Ruby versions:
DEBUG [3bbf2dfd] 2.4.0
DEBUG [3bbf2dfd]
"gem list" 在两台机器上显示 : bundler (1.14.6),在我的生产机器和服务器上显示 ruby 2.4.0。 如何进行?
我正在发布我的 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
# If you are using rbenv add these lines:
require 'capistrano/rbenv'
set :rbenv_type, :user
set :rbenv_ruby, '2.3.1'
require 'capistrano/bundler'
require 'capistrano/rails'
require 'capistrano/passenger'
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
我的deploy.rb:
# config valid only for current version of Capistrano
lock "3.8.1"
set :application, "deploy_test1"
set :repo_url, "git@bitbucket.org:confidentialname/deploy_test1.git"
set :deploy_to, '/home/deploy/deploy_test1'
#append :linked_files, "config/database.yml", "config/secrets.yml"
append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "vendor/bundle", "public/system", "public/uploads"
看起来 rbenv
设置为 运行 Ruby 2.3.1。您在日志中的多个位置 RBENV_VERSION="2.3.1"
。根据 the rbenv documentation,您可以找到 rbenv version
是如何设置的。如果你想测试 Ruby 2.4.0,你需要指向那个版本。或者,如果您真的想在 2.3.1 上 运行,则需要安装捆绑器。