Whenever you start working on a Rails project, the first thing you should do is to run Bundler, to make sure all the app's gems are installed. Switch to the app's root directory (presumably rottenpotatoes-rails-intro) and run bundle install --without production (you only need to specify --without production the first time, as this setting will be remembered on future runs of Bundler for this project).
Finally, get the local database created:
$ rake db:migrateSelf Check Question: How does Rails decide where and how to create the development database? (Hint: check the db and config subdirectories)
Therake db:migratecommand creates a local development database (following the specifications inconfig/database.yml) and runs the migrations indb/migrateto create the app's schema. It also creates/updates the filedb/schema.rbto reflect the latest database schema. Note: it's important to keep this file under version control.
Self Check Question: What tables got created by the migrations?
Themoviestable itself and the rails-internalschema_migrationstable that records which migrations have been run.
Now insert "seed data" into the database--initial data items that the app needs to run:
$ rake db:seedSelf Check Question: What seed data was inserted and where was it specified? (Hint: rake -T db:seed explains the seed task; rake -T explains other available Rake tasks)
A set of movie data which is specified in db/seeds.rb
At this point you should be able to run the app locally (rails server) and navigating to http://localhost:3000/movies in your browser. If you are using c9, use rails s -p $PORT -b $IP and navigate to the link generated within c9.