Skip to content

Commit 5eba40b

Browse files
committed
Fixes conflict in describing docker-compose problems
- removes troubleshooting log text Merge branch 'develop' of https://github.com/RefugeRestrooms/refugerestrooms into develop
2 parents 7c6ee36 + 7aaf380 commit 5eba40b

File tree

2 files changed

+36
-6
lines changed

2 files changed

+36
-6
lines changed

CONTRIBUTING.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,20 @@ _(Older Mac or Windows PC? See [instructions for Docker Toolbox](https://github.
1313

1414
_(Running Linux? See [instructions for Docker CE on Linux](https://github.com/RefugeRestrooms/refugerestrooms/wiki/How-to-use-Docker-CE-on-Linux-with-Refuge-Restrooms).)_
1515

16-
### 3 Build the Docker Container
17-
Build the container from any [terminal](https://github.com/RefugeRestrooms/refugerestrooms/wiki/What-is-a-Terminal-(or-%22Terminal-Emulator%22)%3F-How-do-I-run-text-based-commands-on-my-computer%3F) program with:
16+
### 3 Build the Docker Containers
17+
Build the containers from any [terminal](https://github.com/RefugeRestrooms/refugerestrooms/wiki/What-is-a-Terminal-(or-%22Terminal-Emulator%22)%3F-How-do-I-run-text-based-commands-on-my-computer%3F) program with:
1818
```
1919
docker-compose build
2020
```
2121

22-
### 4 Run the Docker Container
22+
Optional: list the containers you just built:
23+
```
24+
docker ps
25+
```
26+
27+
You should see two containers: refugerestrooms_web and postgres.
28+
29+
### 4 Run the Docker Containers
2330

2431
You can now run the app with:
2532
```
@@ -40,16 +47,40 @@ If you need to run commands on the Docker container directly, run this:
4047
```
4148
docker-compose run web bash
4249
```
43-
_(This will give you a full interactive terminal session running on the Docker machine. You can (for example) run `bundle update` to update the Gems in the Gemfile to more recent versions.)_
50+
_(This will give you a full interactive terminal session running on the Docker machine. For example, run `bundle update` to update the Gems in the Gemfile to more recent versions, or `rails console` to access web objects like `Restroom.first`.)_
4451

4552
Occasionally, you might need to rebuild the Docker machine so it picks up major updates (such as a new version of Ruby, or an updated Gemfile). To do so, run `docker-compose down` and `docker-compose build`.
4653

54+
If you want to access the postgres container to reach the psql command line do
55+
56+
```
57+
docker-compose run db bash
58+
psql -h refugerestrooms_db_1 -U postgres
59+
```
60+
61+
or equivalently:
62+
```
63+
docker-compose run db psql -h refugerestrooms_db_1 -U postgres
64+
```
65+
4766
### 6 Run the Tests
4867
```
49-
docker-compose run -e "RAILS_ENV=test" web rake db:test:prepare spec
68+
docker-compose run -e "RAILS_ENV=test" web rake db:migrate:reset spec
5069
```
5170
_(If you want to know if your changes pass our automated testing, before even submitting your changes to RefugeRestrooms on Github, this will let you know.)_
5271

72+
If you want to run an individual spec, first log in to the container, then the spec. E.g.:
73+
```
74+
docker-compose run web bash
75+
rspec spec/models/restroom_spec.rb
76+
```
77+
78+
This is equivalent, but slower during a code-test-code-test development cycle:
79+
80+
```
81+
docker-compose run web rspec spec/models/restroom_spec.rb
82+
```
83+
5384
### 7 Shut down the Docker Container:
5485
In another terminal window, run:
5586
```

app/controllers/users/registrations_controller.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class Users::RegistrationsController < Devise::RegistrationsController
1111

1212
# POST /resource
1313
def create
14-
puts "**********************************************************"
1514
super
1615
UserMailer.approve_new_user_email(@user).deliver_now
1716
end

0 commit comments

Comments
 (0)