我正在嘗試與Capistrano部署Rails應用程序。它基於Rails 5.1。 Ruby版本由rvm管理。 我正在使用ruby 2.2.3,手動創建gemset。 這裏是deploy.rbCapistrano/rails無法與rvm配合使用
set :rvm_type, :user
set :rvm_ruby_version, '[email protected]'
...
with RAILS_ENV: fetch(:environment) do
execute :rake, "webpacker:install"
end
所以,似乎工作時,Rails的< 5.0。但是,當滑軌> 5.0,的WebPack應該通過這個命令安裝:
bundle exec rails webpacker:install
(而不是捆綁耙)
with RAILS_ENV: fetch(:environment) do
execute :rails, "webpacker:install"
end
但它不爲我工作。我已經安裝了捆綁在寶石我使用,但得到的錯誤:
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 [email protected]: rails
exit status: 127
rails stdout: Nothing written
rails stderr: bash: bundle: command not found
當然,我包括Capistrano的/軌在我capfile。
capistrano/rvm
capistrano/rails
我不知道爲什麼我得到錯誤。我認爲我配置正確,但... 無論如何,你想幫我解決這個問題嗎?
爲什麼了創建gemsets?捆綁商現在是否完全不需要這樣做? – bkunzi01
bkunzi01 - 我不確定你的意思。 bundler安裝在gemset裏面。 – Deimos620