【问题标题】:VPS rbenv location directory is wrong when using Capistrano3使用 Capistrano3 时 VPS rbenv 位置目录错误
【发布时间】:2015-05-04 17:22:23
【问题描述】:

我的 Centos 7 的 rbenv 位于 /root/.rbenv,但是当我运行 cap production deploy:setup_config 时,它会在 /usr/local/rbenv 中搜索 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 -)" 

宝石文件

# Use Capistrano for deployment
group :development do
  gem 'capistrano-rails'
  gem 'capistrano-bundler'
  gem 'capistrano-rbenv', github: "capistrano/rbenv"
end

头文件

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

【问题讨论】:

    标签: ruby-on-rails rbenv capistrano3 centos7


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-21
      • 1970-01-01
      • 1970-01-01
      • 2021-08-14
      • 1970-01-01
      • 2012-03-24
      • 2018-09-27
      • 2023-03-30
      相关资源
      最近更新 更多