繁体   English   中英

使用Capistrano3时,VPS rbenv位置目录错误

[英]VPS rbenv location directory is wrong when using Capistrano3

我的Centos 7在/root/.rbenv中有/root/.rbenv ,但是当我运行cap production deploy:setup_config它会在/usr/local/rbenv搜索/usr/local/rbenv

错误信息

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

您在这方面的问题。 您应该为rbenv_type变量指定:user值,因为您已经将rbenv安装到用户目录中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM