卡西斯特拉诺,找不到宝石文件错误



我正在使用jruby 1.7,puma和capistrano与rails 4应用程序。

目前我有 1 个命令无法运行 capistrano:

Command: 
cd /path_to_my_application/deploy/releases/20141209190535 && ( PATH=$HOME/jdk/bin:$PATH RAILS_ENV=staging ~/.rvm/bin/rvm default do bundle exec rake assets:precompile )
DEBUG[d1a0d859]     Could not locate Gemfile

在我遇到此命令错误之前,该命令确实收到相同的错误消息Could not locate Gemfile

Command: cd /path_to_my_application/deploy/releases/20141209190535 && ( PATH=$HOME/jdk/bin:$PATH ~/.rvm/bin/rvm default do bundle install --binstubs /path_to_my_application/deploy/shared/bin --gemfile path_to_my_application/current/my_app/Gemfile --path /apath_to_my_application/deploy/shared/bundle --without development test --deployment --quiet )

但后来我添加了这些行

set :bundle_gemfile, "#{release_path}/housingsystem/Gemfile" SSHKit.config.command_map[:rake] = "bundle exec rake"到我的my_app/config/deploy/staging.rb,然后它开始工作,直到预编译任务开始说Could not locate Gemfile

知道是什么原因造成的吗?

我的宝石文件如下所示:

group :development, :test do
  # Use Capistrano for deployment
  gem 'capistrano-rails'
  gem 'capistrano-bundler'
  gem 'capistrano-rvm'
  gem 'capistrano3-puma'
  # Create architecture diagrams
  gem 'railroady'
end

我的Capfile看起来像这样:

# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Includes tasks from other gems included in your Gemfile
# https://github.com/capistrano/rvm
require 'capistrano/rvm'
# https://github.com/capistrano/bundler
require 'capistrano/bundler'
# https://github.com/capistrano/rails
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
# https://github.com/seuros/capistrano-puma
require 'capistrano/puma'
# https://github.com/javan/whenever#capistrano-v3-integration
require 'whenever/capistrano'
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

所以知道为什么PATH=$HOME/jdk/bin:$PATH RAILS_ENV=staging ~/.rvm/bin/rvm default do bundle exec rake assets:precompile告诉我找不到 Gemfile吗?

尝试设置

set :puma_prune_bundler, true

https://github.com/puma/puma/issues/329

最新更新