[英]LoadError: cannot load such file — bundler/setup capistrano
Edit #1 编辑#1
Here is the log 这是日志
** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:
DEBUG [d8da8d91] Command: if test ! -d /home/poladmin/poetry_out_loud_v2/releases/20180629192529; then echo "Directory does not exist '/home/poladmin/poetry_out_loud_v2/releases/20180629192529'" 1>&2; false; fi
DEBUG [d8da8d91] Finished in 0.495 seconds with exit status 0 (successful).
INFO [64734ae3] Running $HOME/.rbenv/bin/rbenv exec rake assets:precompile as poladmin@196.28.51.162
DEBUG [64734ae3] Command: cd /home/poladmin/poetry_out_loud_v2/releases/20180629192529 && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.5.1" RAILS_ENV="production" RAILS_GROUPS="" ; $HOME/.rbenv/bin/rbenv exec rake assets:precompile )
DEBUG [64734ae3] rake aborted!
Bundler::GemNotFound: Could not find rake-12.3.1 in any of the sources
DEBUG [64734ae3] /home/poladmin/poetry_out_loud_v2/releases/20180629192529/config/boot.rb:3:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629192529/config/application.rb:1:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629192529/config/application.rb:1:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629192529/Rakefile:4:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629192529/Rakefile:4:in `<top (required)>'
DEBUG [64734ae3]
Caused by:
DEBUG [64734ae3] LoadError: cannot load such file -- bundler/setup
DEBUG [64734ae3] /home/poladmin/poetry_out_loud_v2/releases/20180629192529/config/boot.rb:3:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629192529/config/application.rb:1:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629192529/config/application.rb:1:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629192529/Rakefile:4:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629192529/Rakefile:4:in `<top (required)>'
The bundler
gem is installed on the server. bundler
gem已安装在服务器上。
Original Question 原始问题
So I'm trying to push my application to a server using capistrano, however, I'm getting a LoadError: cannot load such file -- bundler/setup
error with the rake gem, however, locally rake is installed. 因此,我尝试使用capistrano将应用程序推送到服务器,但是,我遇到了
LoadError: cannot load such file -- bundler/setup
gem出现LoadError: cannot load such file -- bundler/setup
错误,但是在本地安装了rake。 Here is the Gemfile: 这是Gemfile:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.1'
gem 'rails', '~> 5.2.0'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'rake', '~> 12.3', '>= 12.3.1'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
gem 'bootsnap', '>= 1.1.0', require: false
gem 'mongoid'
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'capistrano', '~> 3.7', '>= 3.7.1'
gem 'capistrano-rails', '~> 1.2'
gem 'capistrano-passenger', '~> 0.2.0'
gem 'capistrano-rbenv', '~> 2.1'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
Any help is appreciated. 任何帮助表示赞赏。
Try require false in gemfile. 尝试在gemfile中要求false。
gem "capistrano", "~> 3.7", require: false
gem "capistrano-rails", "~> 1.2", require: false
If you're using rbenv
or similar, your bundler and gems might be installed in a different env than your deploy login. 如果您使用的是
rbenv
或类似产品,则捆绑程序和gems可能安装在与部署登录名不同的环境中。 You need to tell Cap that. 您需要告诉Cap。 I use this:
我用这个:
set :rbenv_ruby, '2.4.1'
set :rbenv_path, '/Users/stmpjmpr/.rbenv'
set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} /usr/local/bin/rbenv exec"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.