簡體   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