質問編集履歴

1

作業手順の詳細を追加

2018/04/07 22:56

投稿

taro_nii_chan
taro_nii_chan

スコア207

test CHANGED
@@ -1 +1 @@
1
- laravelのvaletでエラーが出力されます
1
+ laravelの"valet install"「Unable to determine linked PHP.」というエラーが出て困っています
test CHANGED
@@ -4,6 +4,8 @@
4
4
 
5
5
  php: PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS )
6
6
 
7
+ ターミナル: iterm2 Build 3.1.5
8
+
7
9
 
8
10
 
9
11
  ### やりたい事
@@ -37,3 +39,295 @@
37
39
  ### 教えていただきたいこと
38
40
 
39
41
  エラーの回避方法と、なぜそのようなエラーが出るかについて教えていただきたいです。
42
+
43
+
44
+
45
+ ### やった事の詳細 ~ 追記(2018.4.8 7:30)
46
+
47
+ ターミナル(iterm2)でやった事を詳しく書いていきます。
48
+
49
+ `~/development/laravel/laracast `はbashプロンプトです。
50
+
51
+
52
+
53
+ - 作業ディレクトリの確認
54
+
55
+ ```
56
+
57
+ ~/development/laravel/laracast  pwd
58
+
59
+ /Users/taro/development/laravel/laracast
60
+
61
+ ```
62
+
63
+
64
+
65
+ - phpのバージョンの確認
66
+
67
+ ```
68
+
69
+ ~/development/laravel/laracast  php -v
70
+
71
+ PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS )
72
+
73
+ Copyright (c) 1997-2017 The PHP Group
74
+
75
+ Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
76
+
77
+ ```
78
+
79
+
80
+
81
+ - composerのインストール
82
+
83
+ ```
84
+
85
+ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
86
+
87
+ php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
88
+
89
+ php composer-setup.php
90
+
91
+ php -r "unlink('composer-setup.php');"
92
+
93
+ ```
94
+
95
+ composer.pharがインストールされたことが確認できた
96
+
97
+
98
+
99
+ - composer.pharを名前を変えて移動
100
+
101
+ ```
102
+
103
+ ~/development/laravel/laracast  mv composer.phar /usr/local/bin/composer
104
+
105
+ ```
106
+
107
+
108
+
109
+ - laravel installerのインストール
110
+
111
+ ```
112
+
113
+ ~/development/laravel/laracast  composer global require "laravel/installer"
114
+
115
+ Changed current directory to /Users/taro/.composer
116
+
117
+ Using version ^2.0 for laravel/installer
118
+
119
+ ./composer.json has been updated
120
+
121
+ Loading composer repositories with package information
122
+
123
+ Updating dependencies (including require-dev)
124
+
125
+ Nothing to install or update
126
+
127
+ Generating autoload files
128
+
129
+ ```
130
+
131
+
132
+
133
+ - パスの確認
134
+
135
+ ```
136
+
137
+ ~/development/laravel/laracast  echo $PATH
138
+
139
+ /Users/taro/.composer/vendor/bin:/Users/taro/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/taro/bin:.
140
+
141
+ ```
142
+
143
+ ~/.composer/vendor/binにパスが通っている
144
+
145
+
146
+
147
+ - laravelが実行できるかの確認
148
+
149
+ ```
150
+
151
+ ~/development/laravel/laracast  laravel -V
152
+
153
+ Laravel Installer 2.0.1
154
+
155
+ ```
156
+
157
+ laravelは実行できるけど、
158
+
159
+ ```
160
+
161
+ ~/development/laravel/laracast  laravel new myBlog
162
+
163
+ ~/development/laravel/laracast  cd myBlog
164
+
165
+ ~/development/laravel/laracast/myBlog  php artisan -V
166
+
167
+ Laravel Framework 5.6.15
168
+
169
+ ```
170
+
171
+ laravel5.6がインストールされてしまう
172
+
173
+
174
+
175
+ `laravel new`でバージョンを指定する仕方が分からないので`laravel new`は一旦あきらめた
176
+
177
+
178
+
179
+ - composerを使ったlaravel5.4のインストール
180
+
181
+ ```
182
+
183
+ ~/development/laravel/laracast  cd ..
184
+
185
+ ~/development/laravel/laracast  composer create-project --prefer-dist laravel/laravel myBlog2 "5.4.*"
186
+
187
+ ~/development/laravel/laracast  cd myBlog2
188
+
189
+ ~/development/laravel/laracast/myBlog2  php artisan -V
190
+
191
+ Laravel Framework 5.4.36
192
+
193
+ ```
194
+
195
+ laravel5.4のインストールに成功
196
+
197
+
198
+
199
+ - laravelのデフォルトページの表示の確認
200
+
201
+ ```
202
+
203
+ ~/development/laravel/laracast/myBlog2  php artisan serve
204
+
205
+ Laravel development server started: <http://127.0.0.1:8000>
206
+
207
+ ```
208
+
209
+ ![イメージ説明](7bfc2ac7d9a98433f8d0f54ca94e94a3.png)
210
+
211
+ ブラウザでhttp://127.0.0.1:8000にアクセスするとデフォルトのページが表示された
212
+
213
+
214
+
215
+ - Homebrewのインストール
216
+
217
+ `https://brew.sh/`に書いてある一行をiterm2で実行
218
+
219
+ ```
220
+
221
+ ~/development/laravel/laracast/myBlog2  /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
222
+
223
+ -e:161: warning: Insecure world writable dir /Users/taro/development/laravel in PATH, mode 040777
224
+
225
+ ==> This script will install:
226
+
227
+ /usr/local/bin/brew
228
+
229
+ /usr/local/share/doc/homebrew
230
+
231
+ (中略)
232
+
233
+ ==> Next steps:
234
+
235
+ - Run `brew help` to get started
236
+
237
+ - Further documentation:
238
+
239
+ https://docs.brew.sh
240
+
241
+ ```
242
+
243
+ brewがインストールされた
244
+
245
+
246
+
247
+ - brewを使ってphp7.1をインストール(?)
248
+
249
+ ```
250
+
251
+ ~/development/laravel/laracast/myBlog2  brew install homebrew/php/php71
252
+
253
+ Warning: Use php@7.1 instead of deprecated homebrew/php/php71
254
+
255
+ Warning: php@7.1 7.1.16 is already installed and up-to-date
256
+
257
+ To reinstall 7.1.16, run `brew reinstall php@7.1`
258
+
259
+ ```
260
+
261
+ `homerew/php/php71`が推奨されていなくて代わりの`php@7.1`が最新の状態でインストールされてる模様
262
+
263
+
264
+
265
+ - valetのインストール
266
+
267
+ ```
268
+
269
+ ~/development/laravel/laracast/myBlog2  composer global require laravel/valet
270
+
271
+ Changed current directory to /Users/taro/.composer
272
+
273
+ Using version ^2.0 for laravel/valet
274
+
275
+ ./composer.json has been updated
276
+
277
+ Loading composer repositories with package information
278
+
279
+ Updating dependencies (including require-dev)
280
+
281
+ Nothing to install or update
282
+
283
+ Generating autoload files
284
+
285
+ ~/development/laravel/laracast/myBlog2  valet -V
286
+
287
+ Laravel Valet 2.0.10
288
+
289
+ ```
290
+
291
+ valetのインストールも出来た様子
292
+
293
+
294
+
295
+ - valet install
296
+
297
+ ```
298
+
299
+ ~/development/laravel/laracast/myBlog2  valet install
300
+
301
+ Stopping nginx...
302
+
303
+ Installing nginx configuration...
304
+
305
+ Installing nginx directory...
306
+
307
+ Updating PHP configuration...
308
+
309
+
310
+
311
+ In Brew.php line 179:
312
+
313
+
314
+
315
+ Unable to determine linked PHP.
316
+
317
+
318
+
319
+
320
+
321
+ install
322
+
323
+ ```
324
+
325
+ とここで本題のエラーが出る
326
+
327
+
328
+
329
+ ### 疑問
330
+
331
+ `valet new`でlaravelのバージョンを指定する方法はありますか?
332
+
333
+ `valet install`でエラーが発生することへの対処法はありますか?