【问题标题】:Capistrano/rails doesn't work with rvmCapistrano/rails 不适用于 rvm
【发布时间】:2017-09-13 17:59:26
【问题描述】:

我正在尝试使用 capistrano 部署 Rails 应用程序。它基于 Rails 5.1。 Ruby 版本由 rvm 管理。 我正在使用 ruby​​ 2.2.3,手动创建 gemset。 这是deploy.rb

set :rvm_type, :user
set :rvm_ruby_version, '2.2.3@cardlove-api'
...
with RAILS_ENV: fetch(:environment) do
  execute :rake, "webpacker:install"
end

所以,当 Rails 5.0 时,应该通过这个命令安装 webpack:

bundle exec rails webpacker:install (而不是捆绑耙)

with RAILS_ENV: fetch(:environment) do
  execute :rails, "webpacker:install"
end

但这对我不起作用。我已经在我正在使用的 gemset 中安装了 bundle,但是出现了错误:

01 bundle exec rails webpacker:install
01 bash: bundle: command not found
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as user@IP: rails 
  exit status: 127
  rails stdout: Nothing written
  rails stderr: bash: bundle: command not found

当然,我的 capfile 中包含 capistrano/rails。

capistrano/rvm
capistrano/rails

我不确定为什么会出错。我想我配置正确,但是...... 无论如何,你愿意帮我解决这个问题吗?

【问题讨论】:

  • 为什么要创建 gemsets 呢? bundler 现在不是完全不需要这个了吗?
  • bkunzi01 - 我不确定你的意思。 bundler 安装在 gemset 中。

标签: ruby-on-rails ruby capistrano capistrano3


【解决方案1】:

您可以使用capistrano/bundler

【讨论】:

  • 感谢您的快速回复。我重新定义了任务并收到另一个错误。 (回溯仅限于导入的任务)上限中止! SSHKit::Runner::ExecuteError: 以 cardeploy@172.104.171.129 身份执行时出现异常:捆绑退出状态:1 捆绑标准输出:未写入捆绑标准错误:未写入任何想法为什么?
  • 介意解释你的答案,否则作为评论更好,因为它本质上只是一个链接
猜你喜欢
  • 1970-01-01
  • 2011-04-07
  • 1970-01-01
  • 2012-12-20
  • 1970-01-01
  • 2011-02-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多