【发布时间】: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