- Ruby (minimum version: 2.4)
- Postgres (minimum version: 9.5)
- Git (minimum version: 2)
- GCC (already included with Apple XCode Developer Tools)
If you've installed Postgres through Homebrew on Mac:
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
If you don't want to start it as a daemon, open a new terminal window and run:
postgres -D /usr/local/var/postgres
Note that closing the terminal window will cause the database to shut down. If you've started the database with Postgres -D
, keep the terminal window open for as long as you need to use the database.
On nix:
sudo systemctl start postgresql
Postgres installations on Linux can vary between OS distributions as well as the package manager used.
When Postgres is installed on a Linux machine, it is often configured by default for security considerations that reflect server operations. Make sure that you are aware of the runtime requirements of Postgres on your environment if you are running Linux.
In particular, many Postgres setups on Linux require passwords for all database connections over TCP. This will either need to be disabled, or passwords will have to be configured for the role used during the workshop exercises.
This is the repository that we'll be working with through the course the workshop.
Clone the workshop repository to your machine:
git clone [email protected]:eventide-tutorial/workshop.git
Or, if you prefer to retrieve the repository over SSH:
git clone https://github.com/eventide-tutorial/workshop.git
cd workshop
cd verify_setup
./install_gems.sh
A database named event_source
along with a user of the same name will be created.
Run:
bundle exec evt-pg-recreate-db
cp settings/event_source_postgres.json.example settings/event_source_postgres.json
If your database installation requires a password (see Note for Linux Users above), edit settings/event_source_postgres.json
and change the password value to the database's password.
./test.sh
If everything is working correctly, you should see the following output:
Running /Users/sbellware/projects/eventide/tutorial/account-component-skeleton/test/automated/database_connection.rb
Database Connection
Connects on first use
Finished running 1 file
Ran 1 test in 0.052s (19.264s tests/second)
1 passed, 0 skipped, 0 failed, 0 total errors
./get_account_code.sh