質問編集履歴

2

質問内容の大幅変更

2019/06/09 09:39

投稿

shigeki-yabune
shigeki-yabune

スコア10

test CHANGED
@@ -1 +1 @@
1
- railsアプリをCapistranoでデプロイする時の,Unicorn周りのエラー
1
+ railsアプリにてrake secret実行時のエラー
test CHANGED
@@ -1,10 +1,4 @@
1
- ### RailsアプリNginx+Unicorn+Capistranoデプロイ時のエラー
1
+ ### Railsアプリrake secret のエラー
2
-
3
-
4
-
5
- #内容に大きな誤りがあったので編集をします。解決策を考えて下さった方、申し訳ありません。
6
-
7
- #出来るだけ早急に内容把握し、編集をします。
8
2
 
9
3
 
10
4
 
@@ -22,153 +16,15 @@
22
16
 
23
17
 
24
18
 
25
- 上記の環境にてAWS EC2インスタンスにデプロイしようと
19
+ secret値を計算するため
26
20
 
27
21
  ```
28
22
 
29
- bundle install
23
+ rake secret
30
-
31
- bundle exec cap production deploy
32
24
 
33
25
  ```
34
26
 
35
- ローカルにて実行しまし
36
-
37
-
38
-
39
- #####参考にしたサイト
40
-
41
- ######[(Capistrano編)世界一丁寧なAWS解説。EC2を利用して、RailsアプリをAWSにあげるまで](https://qiita.com/naoki_mochizuki/items/657aca7531b8948d267b)
42
-
43
-
44
-
45
- ### 発生している問題・エラーメッセージ
46
-
47
- 一部抜粋
48
-
49
- ```
50
-
51
- 00:14 deploy:symlink:release
52
-
53
- 01 ln -s /var/www/jackMembers/releases/20190606052721 /var/www/jackMembers/releases/current
54
-
55
- ✔ 01 shigeki@54.64.134.219 0.142s
56
-
57
- 02 mv /var/www/jackMembers/releases/current /var/www/jackMembers
58
-
59
- ✔ 02 shigeki@54.64.134.219 0.139s
60
-
61
- #<Thread:0x00007f97eeba9450@/Users/shigeki/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sshkit-1.18.2/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
62
-
63
- Traceback (most recent call last):
64
-
65
- 1: from /Users/shigeki/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sshkit-1.18.2/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
66
-
67
- /Users/shigeki/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sshkit-1.18.2/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as shigeki@54.64.134.219: Don't know how to build task 'unicorn:restart' (See the list of available tasks with `rake --tasks`) (SSHKit::Runner::ExecuteError)
68
-
69
- (Backtrace restricted to imported tasks)
70
-
71
- cap aborted!
72
-
73
- SSHKit::Runner::ExecuteError: Exception while executing as shigeki@54.64.134.219: Don't know how to build task 'unicorn:restart' (See the list of available tasks with `rake --tasks`)
74
-
75
-
76
-
77
-
78
-
79
- Caused by:
80
-
81
- Don't know how to build task 'unicorn:restart' (See the list of available tasks with `rake --tasks`)
82
-
83
-
84
-
85
- Tasks: TOP => deploy:restart
86
-
87
- (See full trace by running task with --trace)
88
-
89
- The deploy has failed with an error: Exception while executing as shigeki@54.64.134.219: Don't know how to build task 'unicorn:restart' (See the list of available tasks with `rake --tasks`)
90
-
91
- ```
92
-
93
-
94
-
95
- ### 該当のソースコード>
96
-
97
- config/deploy.rb
98
-
99
- にて
100
-
101
- ```
102
-
103
- namespace :deploy do
104
-
105
- desc 'Restart application'
106
-
107
- task :restart do
108
-
109
- on roles(:app) do
110
-
111
- invoke 'unicorn:restart'
112
-
113
- end
114
-
115
- end
116
-
117
- ・・・
118
-
119
- ```
120
-
121
- という箇所があり、
122
-
123
- config/capistrano/tasks/unicorn.rb
124
-
125
- というファイルの
126
-
127
- ```
128
-
129
- #既にunicornが起動している場合再起動を、まだの場合起動を行うtask
130
-
131
- desc "Restart unicorn server gracefully"
132
-
133
- task restart: :environment do
134
-
135
- on roles(:app) do
136
-
137
- if test("[ -f #{fetch(:unicorn_pid)} ]")
138
-
139
- reload_unicorn
140
-
141
- else
142
-
143
- start_unicorn
144
-
145
- end
146
-
147
- end
148
-
149
- end
150
-
151
- ```
152
-
153
- この部分を呼び出すタイミングでのエラーではないかと思うのですが、
154
-
155
- 知識が足りず、詳細については全くわかりません。
156
-
157
-
158
-
159
- ### 試したこと
160
-
161
-
162
-
163
- エラーログの通り、
164
-
165
- ```
166
-
167
- $ rake --task
168
-
169
- ```
170
-
171
- を実行したところ、以下のエラーメッセージが表示されました。
27
+ コマンドを実行したのですが、
172
28
 
173
29
  ```
174
30
 
@@ -197,3 +53,29 @@
197
53
  (See full trace by running task with --trace)
198
54
 
199
55
  ```
56
+
57
+ とのエラー文が出力されました。
58
+
59
+
60
+
61
+ 解決方法がわからないです。
62
+
63
+
64
+
65
+ ### 行ったこと
66
+
67
+ ```
68
+
69
+ gem install rake
70
+
71
+ ```
72
+
73
+ を実行した上でもう一度
74
+
75
+ ```
76
+
77
+ rake secret
78
+
79
+ ```
80
+
81
+ を実行しましたが、解決されませんでした。

1

内容の誤りの告知。内容については未編集

2019/06/09 09:39

投稿

shigeki-yabune
shigeki-yabune

スコア10

test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,10 @@
1
1
  ### RailsアプリNginx+Unicorn+Capistranoデプロイ時のエラー
2
+
3
+
4
+
5
+ #内容に大きな誤りがあったので編集をします。解決策を考えて下さった方、申し訳ありません。
6
+
7
+ #出来るだけ早急に内容把握し、編集をします。
2
8
 
3
9
 
4
10