You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _assignments/assignment_11.md
+3-28
Original file line number
Diff line number
Diff line change
@@ -20,32 +20,7 @@ Now run the `webpacker:install` rails rake task.
20
20
docker-compose run --rm app bundle exec rails webpacker:install
21
21
```
22
22
23
-
> **Note**: You should see an error message. This is expected!\_
24
-
25
-
Looks like yarn is not installed! Let's install yarn by changing the `Dockerfile`
26
-
27
-
```
28
-
RUN apk add --update --no-cache \
29
-
bash \
30
-
build-base \
31
-
nodejs \
32
-
sqlite-dev \
33
-
tzdata \
34
-
postgresql-dev \
35
-
yarn
36
-
```
37
-
38
-
And now you'll need to rebuild the app container
39
-
40
-
```
41
-
docker-compose build app
42
-
```
43
-
44
-
We can rerun the `webpacker:install` task now that yarn is installed.
45
-
46
-
```
47
-
docker-compose run --rm app bundle exec rails webpacker:install
48
-
```
23
+
> **Note**: We have already added yarn to the Docker image – normally you would need to add yarn as a dependency prior to this step.
49
24
50
25
If you run a `git status`, You'll see quite a few files were created and then `yarn install` was run.
51
26
@@ -90,7 +65,7 @@ Let’s try booting up the server again.
90
65
docker-compose up app
91
66
```
92
67
93
-
> **Note**: We’ll see another error. It’s because we removed the node*modules directory – now that we have a volume mounted let’s install those again.*
68
+
> **Note**: We’ll see another error. It’s because we removed the node\_modules directory – now that we have a volume mounted let’s install those again.*
94
69
95
70
```
96
71
docker-compose run --rm app yarn install
@@ -102,7 +77,7 @@ And let’s boot the server up again.
102
77
docker-compose up app
103
78
```
104
79
105
-
And also notice on your local disk, the `node_modules` directory exists but it is empty!
80
+
And also notice on your local disk, the `node_modules` directory exists but now it is empty!
106
81
107
82
Okay! We also need to revisit the `Dockerfile` to run `yarn install` so that if other engineers on your team pull the app they don’t run into the same yarn install error we just saw.
0 commit comments