Chinook is a Rails application destined to help you practice various ActiveRecord queries. It is based on this dataset, but translated to work with Rails and ActiveRecord.
Chinook doesn't currently have a user interface, but feel free to add one!
Chinook uses a PostgreSQL database. You'll need to have it installed and running.
Installing PostgreSQL with Homebrew or with the Postgres.app are recommended.
If you're on a Mac and installed the Postgres.app, you might need to add the psql command to bash by inserting the following line into your .bash_profile.
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin
You can also install PGAdminIII to be able to browse your databases:
- Download version 1.18.1 here
- Once you've downloaded the .dmg, load it up and drag the PGAdmin app to your applications folder
- If you're on Mavericks, you'll need to right-click and "open" the app to launch it
This also includes instructions on how to install PGAdminIII, which is a UI you can use to browse your databases!
Once you've installed PostgreSQL, start by setting up the database by typing the following in your terminal:
rake db:setup
There's a lot of data to load, so instead of using seeds, we're going to manually import a SQL file with Postgres command line. This make take a moment.
psql chinook_development < chinook.sql
Once you're done loading your data, it's time to play! Fire up your Rails Console!
rails console
or for short
rails c