質問編集履歴
7
test
CHANGED
File without changes
|
test
CHANGED
@@ -164,8 +164,6 @@
|
|
164
164
|
|
165
165
|
|
166
166
|
|
167
|
-
マルチ
|
167
|
+
マルチ
|
168
|
-
|
169
|
-
既にしてしまったので貼ります
|
170
168
|
|
171
169
|
[こちら](https://ja.stackoverflow.com/questions/72138/node-js%e3%81%a7%e3%82%a2%e3%83%83%e3%83%97%e3%83%87%e3%83%bc%e3%83%88%e3%82%a8%e3%83%a9%e3%83%bc-autoprefixer-doesn-t-support-node-v6-17-1-update-it)
|
6
f
test
CHANGED
File without changes
|
test
CHANGED
@@ -161,3 +161,11 @@
|
|
161
161
|
-bash: nodejs: command not found
|
162
162
|
|
163
163
|
```
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
マルチポストが推奨されていないことを知りませんでした
|
168
|
+
|
169
|
+
既にしてしまったので貼ります
|
170
|
+
|
171
|
+
[こちら](https://ja.stackoverflow.com/questions/72138/node-js%e3%81%a7%e3%82%a2%e3%83%83%e3%83%97%e3%83%87%e3%83%bc%e3%83%88%e3%82%a8%e3%83%a9%e3%83%bc-autoprefixer-doesn-t-support-node-v6-17-1-update-it)
|
5
f
test
CHANGED
File without changes
|
test
CHANGED
@@ -126,6 +126,34 @@
|
|
126
126
|
|
127
127
|
|
128
128
|
|
129
|
+
Capfile
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
```
|
134
|
+
|
135
|
+
require "capistrano/setup"
|
136
|
+
|
137
|
+
require "capistrano/deploy"
|
138
|
+
|
139
|
+
require 'capistrano/rbenv'
|
140
|
+
|
141
|
+
require 'capistrano/bundler'
|
142
|
+
|
143
|
+
require 'capistrano/rails/assets'
|
144
|
+
|
145
|
+
require 'capistrano/rails/migrations'
|
146
|
+
|
147
|
+
require 'capistrano3/unicorn'
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }
|
152
|
+
|
153
|
+
```
|
154
|
+
|
155
|
+
|
156
|
+
|
129
157
|
```
|
130
158
|
|
131
159
|
nodejs -v
|
4
ff
test
CHANGED
File without changes
|
test
CHANGED
@@ -50,45 +50,73 @@
|
|
50
50
|
|
51
51
|
##追記
|
52
52
|
|
53
|
-
|
53
|
+
deploy.rb
|
54
54
|
|
55
55
|
```
|
56
56
|
|
57
|
-
|
57
|
+
# config valid only for current version of Capistrano
|
58
58
|
|
59
|
-
|
59
|
+
# capistranoのバージョンを記載。固定のバージョンを利用し続け、バージョン変更によるトラブルを防止する
|
60
60
|
|
61
|
-
|
61
|
+
lock '3.14.1'
|
62
62
|
|
63
63
|
|
64
64
|
|
65
|
-
Ca
|
65
|
+
# Capistranoのログの表示に利用する
|
66
66
|
|
67
|
-
if Rails.env.development? || Rails.env.test?
|
68
|
-
|
69
|
-
elsif Rails.env.production?
|
70
|
-
|
71
|
-
config.storage = :fog
|
72
|
-
|
73
|
-
config.fog_provider = 'fog/aws'
|
74
|
-
|
75
|
-
config.fog_credentials = {
|
76
|
-
|
77
|
-
provider: 'AWS',
|
78
|
-
|
79
|
-
aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
|
80
|
-
|
81
|
-
aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
|
82
|
-
|
83
|
-
|
67
|
+
set :application, 'baseball-app'
|
84
|
-
|
85
|
-
}
|
86
68
|
|
87
69
|
|
88
70
|
|
89
|
-
|
71
|
+
# どのリポジトリからアプリをpullするかを指定する
|
90
72
|
|
73
|
+
set :repo_url, 'git@github.com:katou02/baseball-app.git'
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
# バージョンが変わっても共通で参照するディレクトリを指定
|
78
|
+
|
79
|
+
set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads')
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
set :rbenv_type, :user
|
84
|
+
|
85
|
+
set :rbenv_ruby, '2.5.1'
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
# どの公開鍵を利用してデプロイするか
|
90
|
+
|
91
|
+
set :ssh_options, auth_methods: ['publickey'],
|
92
|
+
|
91
|
-
|
93
|
+
keys: ['~/.ssh/rails-baseball.pem']
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
# プロセス番号を記載したファイルの場所
|
98
|
+
|
99
|
+
set :unicorn_pid, -> { "#{shared_path}/tmp/pids/unicorn.pid" }
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
# Unicornの設定ファイルの場所
|
104
|
+
|
105
|
+
set :unicorn_config_path, -> { "#{current_path}/config/unicorn.rb" }
|
106
|
+
|
107
|
+
set :keep_releases, 5
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
# デプロイ処理が終わった後、Unicornを再起動するための記述
|
112
|
+
|
113
|
+
after 'deploy:publishing', 'deploy:restart'
|
114
|
+
|
115
|
+
namespace :deploy do
|
116
|
+
|
117
|
+
task :restart do
|
118
|
+
|
119
|
+
invoke 'unicorn:restart'
|
92
120
|
|
93
121
|
end
|
94
122
|
|
3
ff
test
CHANGED
File without changes
|
test
CHANGED
@@ -46,7 +46,11 @@
|
|
46
46
|
|
47
47
|
|
48
48
|
|
49
|
+
|
50
|
+
|
51
|
+
##追記
|
52
|
+
|
49
|
-
|
53
|
+
carriawave.rb
|
50
54
|
|
51
55
|
```
|
52
56
|
|
@@ -91,3 +95,13 @@
|
|
91
95
|
end
|
92
96
|
|
93
97
|
```
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
```
|
102
|
+
|
103
|
+
nodejs -v
|
104
|
+
|
105
|
+
-bash: nodejs: command not found
|
106
|
+
|
107
|
+
```
|
2
r
test
CHANGED
File without changes
|
test
CHANGED
@@ -46,7 +46,7 @@
|
|
46
46
|
|
47
47
|
|
48
48
|
|
49
|
-
carriawave.rb
|
49
|
+
###carriawave.rb
|
50
50
|
|
51
51
|
```
|
52
52
|
|
1
s
test
CHANGED
File without changes
|
test
CHANGED
@@ -43,3 +43,51 @@
|
|
43
43
|
|
44
44
|
|
45
45
|
ご教授お願いします
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
carriawave.rb
|
50
|
+
|
51
|
+
```
|
52
|
+
|
53
|
+
require 'carrierwave/storage/abstract'
|
54
|
+
|
55
|
+
require 'carrierwave/storage/file'
|
56
|
+
|
57
|
+
require 'carrierwave/storage/fog'
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
CarrierWave.configure do |config|
|
62
|
+
|
63
|
+
if Rails.env.development? || Rails.env.test?
|
64
|
+
|
65
|
+
elsif Rails.env.production?
|
66
|
+
|
67
|
+
config.storage = :fog
|
68
|
+
|
69
|
+
config.fog_provider = 'fog/aws'
|
70
|
+
|
71
|
+
config.fog_credentials = {
|
72
|
+
|
73
|
+
provider: 'AWS',
|
74
|
+
|
75
|
+
aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
|
76
|
+
|
77
|
+
aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
|
78
|
+
|
79
|
+
region: 'ap-northeast-1'
|
80
|
+
|
81
|
+
}
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
config.fog_directory = 'rails-baseball-app'
|
86
|
+
|
87
|
+
config.asset_host = 'https://s3-ap-northeast-1.amazonaws.com/rails-baseball-app'
|
88
|
+
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
```
|