我在capistrano 3中运行cap production deploy
时收到以下消息。
DEBUG [5021b4ce] Running /usr/bin/env [ ! -d /usr/local/rbenv/versions/2.0.0-p451 ] on example.com
DEBUG [5021b4ce] Command: [ ! -d /usr/local/rbenv/versions/2.0.0-p451 ]
DEBUG [5021b4ce] Finished in 0.853 seconds with exit status 1 (failed).
这是rbenv
config/deploy.rb
的一部分。
set :rbenv_type, :system # or :user, depends on your rbenv setup
set :rbenv_ruby, '2.0.0-p451'
set :rbenv_path, '/usr/local/rbenv'
set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"
set :rbenv_map_bins, %w{rake gem bundle ruby rails}
set :rbenv_roles, :all # default value
我认为Capistrano
应该检查rbenv
目录的存在。
为什么命令是[ ! -d #{rbenv_dir}]
而不是[ -d #{rbenv_dir}]
?