VPS 使用 Capistrano3 时 rbenv 位置目录错误
VPS rbenv location directory is wrong when using Capistrano3
我的 Centos 7 的 rbenv 位于 /root/.rbenv
,但是当我 运行 cap production deploy:setup_config
它在 /usr/local/rbenv
.
中搜索 rbenv
Error Message
DEBUG [6a1407a4] Running /usr/bin/env [ -d /usr/local/rbenv/versions/2.2.0 ] as root@111.111.111.11
DEBUG [6a1407a4] Command: [ -d /usr/local/rbenv/versions/2.2.0 ]
DEBUG [6a1407a4] Finished in 6.403 seconds with exit status 1 (failed).
ERROR rbenv: 2.2.0 is not installed or not found in /usr/local/rbenv/versions/2.2.0
.bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=$PATH:$HOME/bin
export PATH
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
Gemfile
# Use Capistrano for deployment
group :development do
gem 'capistrano-rails'
gem 'capistrano-bundler'
gem 'capistrano-rbenv', github: "capistrano/rbenv"
end
Capfile
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rbenv'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
Dir.glob('lib/capistrano/*/*.rb').each { |r| import r }
rbenv 应该在 /usr/local/
里面吗? Capistrano 的配置有问题吗?我在 deploy.rb 和 lib/capistrano/*
中搜索了任务,但没有找到 /usr/local/
.
的参考资料
我对 Capistrano 设置的引用来自这个 git。
您的问题 this line。您应该为 rbenv_type
变量指定 :user
值,因为您已经将 rbenv 安装到用户目录。
我的 Centos 7 的 rbenv 位于 /root/.rbenv
,但是当我 运行 cap production deploy:setup_config
它在 /usr/local/rbenv
.
Error Message
DEBUG [6a1407a4] Running /usr/bin/env [ -d /usr/local/rbenv/versions/2.2.0 ] as root@111.111.111.11
DEBUG [6a1407a4] Command: [ -d /usr/local/rbenv/versions/2.2.0 ]
DEBUG [6a1407a4] Finished in 6.403 seconds with exit status 1 (failed).
ERROR rbenv: 2.2.0 is not installed or not found in /usr/local/rbenv/versions/2.2.0
.bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=$PATH:$HOME/bin
export PATH
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
Gemfile
# Use Capistrano for deployment
group :development do
gem 'capistrano-rails'
gem 'capistrano-bundler'
gem 'capistrano-rbenv', github: "capistrano/rbenv"
end
Capfile
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rbenv'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
Dir.glob('lib/capistrano/*/*.rb').each { |r| import r }
rbenv 应该在 /usr/local/
里面吗? Capistrano 的配置有问题吗?我在 deploy.rb 和 lib/capistrano/*
中搜索了任务,但没有找到 /usr/local/
.
我对 Capistrano 设置的引用来自这个 git。
您的问题 this line。您应该为 rbenv_type
变量指定 :user
值,因为您已经将 rbenv 安装到用户目录。