質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.49%
Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

346閲覧

capistrano3.11.0でのデプロイでエラーの解決方法がわからないのでご教示お願いします。

koume

総合スコア458

Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2019/03/13 03:14

前提・実現したいこと

capistrano3.11.0でデプロイをしたいのです。

ここに質問の内容を詳しく書いてください。
$ bundle exec cap production deploy --trace --dry-run を実行しましたが、Gemfileの記述不足と思われるエラーが発生しましたのでGemfileに以下を追記し$ bundle installを実行したところエラーなのかわかりませんが上手くいかないのでご教示お願いします。

発生している問題・エラーメッセージ

$ bundle exec cap production deploy --trace --dry-run  cap aborted!  LoadError: cannot load such file -- capistrano/passenger

該当のソースコード

Gemfileに追記 gem 'capistrano-passenger', require: false

試したこと

Gemfileに追記 gem 'capistrano-passenger', require: false $ bundle install Fetching capistrano-passenger 0.2.0 Installing capistrano-passenger 0.2.0 Bundle complete! 43 Gemfile dependencies, 113 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. Post-install message from capistrano-passenger: ==== Release notes for capistrano-passenger ==== passenger once had only one way to restart: `touch tmp/restart.txt` Beginning with passenger v4.0.33, a new way was introduced: `passenger-config restart-app` The new way to restart was not initially practical for everyone, since for versions of passenger prior to v5.0.10, it required your deployment user to have sudo access for some server configurations. capistrano-passenger gives you the flexibility to choose your restart approach, or to rely on reasonable defaults. If you want to restart using `touch tmp/restart.txt`, add this to your config/deploy.rb: set :passenger_restart_with_touch, true If you want to restart using `passenger-config restart-app`, add this to your config/deploy.rb: set :passenger_restart_with_touch, false # Note that `nil` is NOT the same as `false` here If you don't set `:passenger_restart_with_touch`, capistrano-passenger will check what version of passenger you are running and use `passenger-config restart-app` if it is available in that version. If you are running passenger in standalone mode, it is possible for you to put passenger in your Gemfile and rely on capistrano-bundler to install it with the rest of your bundle. If you are installing passenger during your deployment AND you want to restart using `passenger-config restart-app`, you need to set `:passenger_in_gemfile` to `true` in your `config/deploy.rb`. ================================================

補足情報(FW/ツールのバージョンなど)

上のメッセージを見ると $ bundle installでcapistrano-passenger 0.2.0はインストールされているようですが
config/deploy.rbについてなにかメッセージが出ていますが何なのかわかりません。

set :passenger_restart_with_touch, true または set :passenger_restart_with_touch, false # Note that `nil` is NOT the same as `false` here

のどちらかを追記するのかな?とは思いますが、どちらなのかわかりません。
現状のconfig/deploy.rbのpassenger関係の記述は以下のようになっております。

set :passenger_rvm_ruby_version, '2.3.1p112' set :passenger_environment_variables, { /path-to/passenger/bin:$PATH } set :passenger_restart_command, "/path-to-passenger/bin/passenger-config restart-app #{deploy_to}"

解決方法のご教示お願いいたします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

config/deploy.rbにset :passenger_restart_with_touch, trueを追記して$ bundle exec cap production deploy --trace --dry-runを実行したらエラーは解決出来ました。単なる記述漏れのようでした。

投稿2019/03/13 03:41

koume

総合スコア458

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.49%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問