我正在使用jruby 1.7,puma和capistrano以及rails 4应用程序。
目前我有一个命令,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
知道可能导致这种情况的原因吗?
My 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?