gpt4 book ai didi

ruby-on-rails - 使用 rvm1-capistrano3 安装 Ruby

转载 作者:太空宇宙 更新时间:2023-11-03 17:23:43 24 4
gpt4 key购买 nike

当我运行时

cap production rvm1:install:ruby

我在控制台输出的末尾收到此错误:

Command: cd ~/apps/foo/releases/20140121133714 && ( PATH=/opt/ruby/bin:$PATH /usr/bin/env /tmp/foo/rvm-auto.sh rvm install . )

Could not determine which Ruby to use; . should contain .rvmrc or .versions.conf or .ruby-version or .rbfu-version or .rbenv-version, or an appropriate line in Gemfile.
cap aborted!

编辑

在我的应用程序的根目录添加一个 .ruby-version 之后,我得到了内容

DEBUG [af3b80bc] Command: cd ~/apps/foo/releases/20140121160854 && /usr/bin/env /tmp/foo/rvm-auto.sh rvm install .
DEBUG [af3b80bc] ruby-2.0.0-p247 is not installed.
DEBUG [af3b80bc] To install do: 'rvm install ruby-2.0.0-p247'
DEBUG [af3b80bc] ruby-2.0.0-p247 is not installed.
DEBUG [af3b80bc] Searching for binary rubies, this might take some time.
DEBUG [af3b80bc] ruby-2.0.0-p247 is not installed.
DEBUG [af3b80bc] Searching for binary rubies, this might take some time.
DEBUG [af3b80bc] No binary rubies available for: ubuntu/12.10/x86_64/system.
DEBUG [af3b80bc] Searching for binary rubies, this might take some time.
DEBUG [af3b80bc] Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
DEBUG [af3b80bc] Searching for binary rubies, this might take some time.
DEBUG [af3b80bc] RVM does not have prediction for required space for system, assuming 150MB should be enough, let us know if it was not.
DEBUG [af3b80bc] Searching for binary rubies, this might take some time.
DEBUG [af3b80bc] Either the ruby interpreter is unknown or there was an error!.

我正在使用 rvm1-capistrano gem 运行 Capistrano 3.1.1。它是开箱即用的实现;没什么特别的。

group :development do
gem 'capistrano', '~> 3.1.0'
gem 'capistrano-rails'
gem 'capistrano-bundler'
gem 'rvm1-capistrano3', require: false
# gem 'capistrano-rvm'
end

# capfile
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rails'
require 'capistrano/bundler'
require 'rvm1/capistrano3'
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }

我还在输出中得到另外两个错误:

Running /usr/bin/env [ -L ~/apps/foo/releases/20140121135720/public/assets ] on foo.com
Command: [ -L ~/apps/foo/releases/20140121135720/public/assets ]
Finished in 0.291 seconds with exit status 1 (failed).
Running /usr/bin/env [ -d ~/apps/foo/releases/20140121135720/public/assets ] on foo.com
Command: [ -d ~/apps/foo/releases/20140121135720/public/assets ]
Finished in 0.295 seconds with exit status 1 (failed).

最佳答案

问题

如果你去远程服务器执行这个:

cd ~/apps/foo/releases/20140121160854 && /usr/bin/env /tmp/foo/rvm-auto.sh rvm install .

你会得到同样的错误,但如果你改为执行它

cd ~/apps/foo/releases/20140121160854 && /usr/bin/env /tmp/foo/rvm-auto.sh rvm install ruby-2.0.0-p247

成功。当 rvm-auto.sh 执行 rvm install . 命令时出现问题。不确定是否是 rvm 问题,但在我看来是这样......

解决方法

如果您在 config/deploy.rb 中指定要安装的 ruby​​ 版本:

set :rvm1_ruby_version, "ruby-2.0.0-p247"

在执行任何 rvm1 任务之前。一切都应该没问题

关于ruby-on-rails - 使用 rvm1-capistrano3 安装 Ruby,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21259983/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com