質問編集履歴
6
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -132,9 +132,9 @@
|
|
132
132
|
|
133
133
|
# Procfile
|
134
134
|
|
135
|
-
-
|
135
|
+
-worker: bundle exec sidekiq -C config/sidekiq.yml
|
136
136
|
|
137
|
-
+
|
137
|
+
+worker: mkdir -p tmp/pids && bundle exec sidekiq -C config/sidekiq.yml
|
138
138
|
|
139
139
|
```ruby
|
140
140
|
|
5
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,17 +20,19 @@
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
|
23
|
+
**heroku**
|
24
24
|
|
25
25
|
```lang-ruby
|
26
26
|
|
27
27
|
#Procfile
|
28
28
|
|
29
|
-
|
29
|
+
clock: bundle exec clockwork lib/clock.rb
|
30
|
+
|
31
|
+
redis: bundle exec redis-server /usr/local/etc/redis.conf
|
32
|
+
|
33
|
+
worker: bundle exec sidekiq -C config/sidekiq.yml
|
30
34
|
|
31
35
|
worker: bundle exec sidekiq -q default -q mailers
|
32
|
-
|
33
|
-
|
34
36
|
|
35
37
|
```
|
36
38
|
|
@@ -38,43 +40,57 @@
|
|
38
40
|
|
39
41
|
**herokuでredisを使用する場合**
|
40
42
|
|
41
|
-
heroku addons:add rediscloud
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
以下を Procfile に追記して、Sidekiqの処理をWorker Dyno上で実行するようにする
|
46
|
-
|
47
|
-
worker: bundle exec sidekiq -q default -q mailers
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
heroku config:set REDIS_PROVIDER=REDISCLOUD_URL
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
43
|
```lang-ruby
|
58
44
|
|
59
|
-
ma-no-MacBook-Air:appname ma$
|
45
|
+
ma-no-MacBook-Air:appname ma$ heroku addons:add rediscloud
|
60
46
|
|
61
|
-
|
47
|
+
Setting config vars and restarting appname... done, v15
|
62
48
|
|
63
|
-
|
49
|
+
REDIS_PROVIDER: REDISCLOUD_URL
|
64
50
|
|
65
|
-
|
51
|
+
ma-no-MacBook-Air:appname ma$ heroku config:set REDIS_PROVIDER=REDISCLOUD_URL
|
66
52
|
|
67
|
-
|
53
|
+
06:57:56 clock.1 | started with pid 2019
|
68
54
|
|
69
|
-
|
55
|
+
06:57:56 redis.1 | started with pid 2020
|
70
56
|
|
71
|
-
|
57
|
+
06:57:56 worker.1 | started with pid 2021
|
72
58
|
|
73
|
-
|
59
|
+
06:57:56 worker.1 | started with pid 2022
|
74
60
|
|
75
|
-
|
61
|
+
06:57:56 redis.1 | [2020] 16 Jul 06:57:56.592 # Creating Server TCP listening socket 127.0.0.1:6379: bind: Address already in use
|
76
62
|
|
63
|
+
06:57:56 redis.1 | exited with code 1
|
64
|
+
|
65
|
+
06:57:56 system | sending SIGTERM to all processes
|
66
|
+
|
67
|
+
06:57:56 worker.1 | terminated by SIGTERM
|
68
|
+
|
77
|
-
|
69
|
+
06:57:56 clock.1 | terminated by SIGTERM
|
70
|
+
|
71
|
+
06:57:56 worker.1 | exited with code 1
|
72
|
+
|
73
|
+
ma-no-MacBook-Air:appname ma$ $ foreman start
|
74
|
+
|
75
|
+
06:57:56 clock.1 | started with pid 2019
|
76
|
+
|
77
|
+
06:57:56 redis.1 | started with pid 2020
|
78
|
+
|
79
|
+
06:57:56 worker.1 | started with pid 2021
|
80
|
+
|
81
|
+
06:57:56 worker.1 | started with pid 2022
|
82
|
+
|
83
|
+
06:57:56 redis.1 | [2020] 16 Jul 06:57:56.592 # Creating Server TCP listening socket 127.0.0.1:6379: bind: Address already in use
|
84
|
+
|
85
|
+
06:57:56 redis.1 | exited with code 1
|
86
|
+
|
87
|
+
06:57:56 system | sending SIGTERM to all processes
|
88
|
+
|
89
|
+
06:57:56 worker.1 | terminated by SIGTERM
|
90
|
+
|
91
|
+
06:57:56 clock.1 | terminated by SIGTERM
|
92
|
+
|
93
|
+
06:57:56 worker.1 | exited with code 1
|
78
94
|
|
79
95
|
```
|
80
96
|
|
@@ -92,20 +108,60 @@
|
|
92
108
|
|
93
109
|
if ENV['REDISCLOUD_URL']
|
94
110
|
|
95
|
-
config.redis = { url: ENV['REDISCLOUD_URL'], namespace: '
|
111
|
+
config.redis = { url: ENV['REDISCLOUD_URL'], namespace: 'sidekiq' }
|
96
112
|
|
97
113
|
end
|
98
114
|
|
99
115
|
else
|
100
116
|
|
101
|
-
config.redis = { url: 'redis://localhost:6379', namespace: '
|
117
|
+
config.redis = { url: 'redis://localhost:6379', namespace: 'sidekiq' }
|
102
118
|
|
103
119
|
end
|
104
120
|
|
105
121
|
end
|
106
122
|
|
123
|
+
```
|
107
124
|
|
108
125
|
|
109
126
|
|
110
127
|
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
下記を試したところ
|
132
|
+
|
133
|
+
# Procfile
|
134
|
+
|
135
|
+
- worker: bundle exec sidekiq -C config/sidekiq.yml
|
136
|
+
|
137
|
+
+ worker: mkdir -p tmp/pids && bundle exec sidekiq -C config/sidekiq.yml
|
138
|
+
|
139
|
+
```ruby
|
140
|
+
|
141
|
+
ma$ heroku config:set REDIS_PROVIDER=REDISCLOUD_URL
|
142
|
+
|
143
|
+
Setting config vars and restarting appname... failed
|
144
|
+
|
145
|
+
! Heroku client internal error.
|
146
|
+
|
147
|
+
! Search for help at: https://help.heroku.com
|
148
|
+
|
149
|
+
! Or report a bug at: https://github.com/heroku/heroku/issues/new
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
Error: read timeout reached (Excon::Errors::Timeout)
|
154
|
+
|
155
|
+
Command: heroku config:set REDIS_PROVIDER=REDISCLOUD_URL
|
156
|
+
|
157
|
+
Version: heroku-toolbelt/3.39.5 (x86_64-darwin10.8.0) ruby/1.9.3
|
158
|
+
|
159
|
+
Error ID: 5255bcc5affd49bc99941d043e703193
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
More information in /Users/ma/.heroku/error.log
|
166
|
+
|
111
167
|
```
|
4
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,6 +18,24 @@
|
|
18
18
|
|
19
19
|
|
20
20
|
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
```lang-ruby
|
26
|
+
|
27
|
+
#Procfile
|
28
|
+
|
29
|
+
redis: bundle exec redis-server
|
30
|
+
|
31
|
+
worker: bundle exec sidekiq -q default -q mailers
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
```
|
36
|
+
|
37
|
+
|
38
|
+
|
21
39
|
**herokuでredisを使用する場合**
|
22
40
|
|
23
41
|
heroku addons:add rediscloud
|
@@ -31,3 +49,63 @@
|
|
31
49
|
|
32
50
|
|
33
51
|
heroku config:set REDIS_PROVIDER=REDISCLOUD_URL
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
```lang-ruby
|
58
|
+
|
59
|
+
ma-no-MacBook-Air:appname ma$ foreman start
|
60
|
+
|
61
|
+
15:45:29 clock.1 | started with pid 6790
|
62
|
+
|
63
|
+
15:45:29 redis.1 | started with pid 6791
|
64
|
+
|
65
|
+
15:45:29 worker.1 | started with pid 6792
|
66
|
+
|
67
|
+
15:45:29 redis.1 | [6791] 14 Jul 15:45:29.392 # Warning: no config file specified, using the default config. In order to specify a config file use /usr/local/bin/redis-server /path/to/redis.conf
|
68
|
+
|
69
|
+
15:45:29 redis.1 | [6791] 14 Jul 15:45:29.394 # Creating Server TCP listening socket *:6379: bind: Address already in use
|
70
|
+
|
71
|
+
15:45:29 redis.1 | exited with code 1
|
72
|
+
|
73
|
+
15:45:29 system | sending SIGTERM to all processes
|
74
|
+
|
75
|
+
15:45:29 worker.1 | terminated by SIGTERM
|
76
|
+
|
77
|
+
15:45:29 clock.1 | terminated by SIGTERM
|
78
|
+
|
79
|
+
```
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
```lang-ruby
|
86
|
+
|
87
|
+
#config/initializers/sidkiq.rb
|
88
|
+
|
89
|
+
Sidekiq.configure_server do |config|
|
90
|
+
|
91
|
+
if Rails.env.production?
|
92
|
+
|
93
|
+
if ENV['REDISCLOUD_URL']
|
94
|
+
|
95
|
+
config.redis = { url: ENV['REDISCLOUD_URL'], namespace: 'mynamespace' }
|
96
|
+
|
97
|
+
end
|
98
|
+
|
99
|
+
else
|
100
|
+
|
101
|
+
config.redis = { url: 'redis://localhost:6379', namespace: 'mynamespace' }
|
102
|
+
|
103
|
+
end
|
104
|
+
|
105
|
+
end
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
```
|
3
修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Rails4.2 heroku
|
1
|
+
Rails4.2 heroku環境だとキューは入るがプロセスが入らない
|
test
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
mailerをSidekiqで非同期としています。
|
2
2
|
|
3
3
|
開発環境では非同期で送信されるのですが、heroku上では送信されません
|
4
|
+
|
5
|
+
heroku環境だとキューは入るのですがプロセスが入らないです。
|
4
6
|
|
5
7
|
|
6
8
|
|
@@ -29,29 +31,3 @@
|
|
29
31
|
|
30
32
|
|
31
33
|
heroku config:set REDIS_PROVIDER=REDISCLOUD_URL
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
sidekiq管理画面
|
36
|
-
|
37
|
-
![イメージ説明][WIDTH:600](b51ef1dda5ab6395f24272527695839f.png)
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
待機状態のキューをクリックすると下記のようになっています。
|
44
|
-
|
45
|
-
開発環境であればビジーにプロセスがキュー: default, mailersとセットsれるのですがheroku環境だとセットされていません
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
```lang-ruby
|
50
|
-
|
51
|
-
{"job_class"=>"ActionMailer::DeliveryJob", "job_id"=>"66c18a4b-e468-408e-beb4-9544c8bcfd99", "queue_name"=>"mailers", "arguments"=>["InquiryMailer", "thanks_email", "deliver_now", {"_aj_globalid"=>"gid://xxxxxx/Inquiry/4"}]} []
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
{"job_class"=>"ActionMailer::DeliveryJob", "job_id"=>"7b7d8d2c-70f8-4705-b04f-a057b00ba16f", "queue_name"=>"mailers", "arguments"=>["InquiryMailer", "received_email", "deliver_now", {"_aj_globalid"=>"gid://xxxxxx/Inquiry/4"}]}
|
56
|
-
|
57
|
-
```
|
2
変更
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Rails4.2 heroku
|
1
|
+
Rails4.2 herokuでSidekiqのmailerが送信されない
|
test
CHANGED
@@ -1,4 +1,14 @@
|
|
1
|
+
mailerをSidekiqで非同期としています。
|
2
|
+
|
1
|
-
|
3
|
+
開発環境では非同期で送信されるのですが、heroku上では送信されません
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
**開発環境手順**
|
8
|
+
|
9
|
+
$ redis-server
|
10
|
+
|
11
|
+
$ bundle exec sidekiq -q default -q mailers
|
2
12
|
|
3
13
|
|
4
14
|
|
@@ -6,118 +16,42 @@
|
|
6
16
|
|
7
17
|
|
8
18
|
|
19
|
+
**herokuでredisを使用する場合**
|
20
|
+
|
9
|
-
|
21
|
+
heroku addons:add rediscloud
|
10
22
|
|
11
23
|
|
12
24
|
|
13
|
-
|
25
|
+
以下を Procfile に追記して、Sidekiqの処理をWorker Dyno上で実行するようにする
|
14
26
|
|
15
|
-
re
|
27
|
+
worker: bundle exec sidekiq -q default -q mailers
|
16
28
|
|
17
|
-
remote: Bundled gems are installed into ./vendor/bundle.
|
18
29
|
|
19
|
-
remote: Post-install message from designmodo-flatuipro-rails:
|
20
30
|
|
21
|
-
re
|
31
|
+
heroku config:set REDIS_PROVIDER=REDISCLOUD_URL
|
22
32
|
|
23
|
-
remote: One *must* run `rails generate flatuipro:install <Flat UI Pro Directory>`
|
24
33
|
|
25
|
-
remote: when gem updated
|
26
34
|
|
27
|
-
|
35
|
+
sidekiq管理画面
|
28
36
|
|
29
|
-
remote: Post-install message from rdoc:
|
30
|
-
|
31
|
-
remote: Depending on your version of ruby, you may need to install ruby rdoc/ri data:
|
32
|
-
|
33
|
-
remote: <= 1.8.6 : unsupported
|
34
|
-
|
35
|
-
remote: = 1.8.7 : gem install rdoc-data; rdoc-data --install
|
36
|
-
|
37
|
-
remote: = 1.9.1 : gem install rdoc-data; rdoc-data --install
|
38
|
-
|
39
|
-
remote: >= 1.9.2 : nothing to do! Yay!
|
40
|
-
|
41
|
-
remote: Post-install message from twitter-bootstrap-rails:
|
42
|
-
|
43
|
-
remote: Important: You may need to add a javascript runtime to your Gemfile in order for bootstrap's LESS files to compile to CSS.
|
44
|
-
|
45
|
-
remote: **********************************************
|
46
|
-
|
47
|
-
remote: ExecJS supports these runtimes:
|
48
|
-
|
49
|
-
remote: therubyracer - Google V8 embedded within Ruby
|
50
|
-
|
51
|
-
remote: therubyrhino - Mozilla Rhino embedded within JRuby
|
52
|
-
|
53
|
-
remote: Node.js
|
54
|
-
|
55
|
-
remote: Apple JavaScriptCore - Included with Mac OS X
|
56
|
-
|
57
|
-
|
37
|
+
![イメージ説明][WIDTH:600](b51ef1dda5ab6395f24272527695839f.png)
|
58
|
-
|
59
|
-
remote: **********************************************
|
60
|
-
|
61
|
-
remote: Bundle completed (198.00s)
|
62
|
-
|
63
|
-
remote: Cleaning up the bundler cache.
|
64
|
-
|
65
|
-
remote: -----> Preparing app for Rails asset pipeline
|
66
|
-
|
67
|
-
remote: Running: rake assets:precompile
|
68
38
|
|
69
39
|
|
70
40
|
|
71
41
|
|
72
42
|
|
73
|
-
|
43
|
+
待機状態のキューをクリックすると下記のようになっています。
|
44
|
+
|
45
|
+
開発環境であればビジーにプロセスがキュー: default, mailersとセットsれるのですがheroku環境だとセットされていません
|
74
46
|
|
75
47
|
|
76
48
|
|
77
|
-
r
|
49
|
+
```lang-ruby
|
78
50
|
|
79
|
-
|
80
|
-
|
81
|
-
remote: /tmp/build_971b272071e9ecd56ae67887853f8dd9/app/assets/javascripts/flatuipro.js:1
|
82
|
-
|
83
|
-
remote: /tmp/build_971b272071e9ecd56ae67887853f8dd9/vendor/bundle/ruby/2.0.0/gems/sprockets-3.2.0/lib/sprockets/resolve.rb:64:in `resolve!'
|
84
|
-
|
85
|
-
remote: /tmp/build_971b272071e9ecd56ae67887853f8dd9/vendor/bundle/ruby/2.0.0/gems/sprockets-3.2.0/lib/sprockets/directive_processor.rb:399:in `resolve'
|
86
|
-
|
87
|
-
..............................
|
51
|
+
{"job_class"=>"ActionMailer::DeliveryJob", "job_id"=>"66c18a4b-e468-408e-beb4-9544c8bcfd99", "queue_name"=>"mailers", "arguments"=>["InquiryMailer", "thanks_email", "deliver_now", {"_aj_globalid"=>"gid://xxxxxx/Inquiry/4"}]} []
|
88
52
|
|
89
53
|
|
90
54
|
|
91
|
-
|
92
|
-
|
93
|
-
remote: (See full trace by running task with --trace)
|
94
|
-
|
95
|
-
remote: !
|
96
|
-
|
97
|
-
remote: ! Precompiling assets failed.
|
98
|
-
|
99
|
-
remote: !
|
100
|
-
|
101
|
-
remote:
|
102
|
-
|
103
|
-
remote: ! Push rejected, failed to compile Ruby app
|
104
|
-
|
105
|
-
remote:
|
106
|
-
|
107
|
-
remote: Verifying deploy....
|
108
|
-
|
109
|
-
remote:
|
110
|
-
|
111
|
-
remote: ! Push rejected to immense-atoll-3128.
|
112
|
-
|
113
|
-
remote:
|
114
|
-
|
115
|
-
To https://git.heroku.com/sdasdwrewerwer.git
|
116
|
-
|
117
|
-
! [remote rejected] master -> master (pre-receive hook declined)
|
118
|
-
|
119
|
-
error: failed to push some refs to 'https://git.heroku.com/immense-atoll-3128.git'
|
120
|
-
|
121
|
-
|
55
|
+
{"job_class"=>"ActionMailer::DeliveryJob", "job_id"=>"7b7d8d2c-70f8-4705-b04f-a057b00ba16f", "queue_name"=>"mailers", "arguments"=>["InquiryMailer", "received_email", "deliver_now", {"_aj_globalid"=>"gid://xxxxxx/Inquiry/4"}]}
|
122
56
|
|
123
57
|
```
|
1
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -74,6 +74,20 @@
|
|
74
74
|
|
75
75
|
|
76
76
|
|
77
|
+
remote: rake aborted!
|
78
|
+
|
79
|
+
remote: Sprockets::FileNotFound: couldn't find file 'fileinput' with type 'application/javascript'
|
80
|
+
|
81
|
+
remote: /tmp/build_971b272071e9ecd56ae67887853f8dd9/app/assets/javascripts/flatuipro.js:1
|
82
|
+
|
83
|
+
remote: /tmp/build_971b272071e9ecd56ae67887853f8dd9/vendor/bundle/ruby/2.0.0/gems/sprockets-3.2.0/lib/sprockets/resolve.rb:64:in `resolve!'
|
84
|
+
|
85
|
+
remote: /tmp/build_971b272071e9ecd56ae67887853f8dd9/vendor/bundle/ruby/2.0.0/gems/sprockets-3.2.0/lib/sprockets/directive_processor.rb:399:in `resolve'
|
86
|
+
|
87
|
+
..............................
|
88
|
+
|
89
|
+
|
90
|
+
|
77
91
|
remote: Tasks: TOP => assets:precompile
|
78
92
|
|
79
93
|
remote: (See full trace by running task with --trace)
|