02. Basic project configuration - max-borisov/ihub-bookshelf GitHub Wiki

Basic database configuration is stored in database.yml file under config directory.

After deleting comments you will get:

default: &default
  adapter: sqlite3
  pool: 5
  timeout: 5000

development:
  <<: *default
  database: db/development.sqlite3

test:
  <<: *default
  database: db/test.sqlite3

production:
  <<: *default
  database: db/production.sqlite3

So we have separated databases for test, development and production environments.

Now we need to update Gemfile(on the project root) which stores the list of gems required for the project.

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.1'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# Enables Haml as the templating engine
gem 'haml-rails'
# Sass port of Bootstrap
gem 'bootstrap-sass', '~> 3.3.4'
# Authentication solution for Rails
gem 'devise'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 3.2'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Ruby interface to the PostgreSQL
gem 'pg', group: :production

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'sqlite3'
  # A library for generating fake data
  gem 'faker'
  # Pretty print your Ruby objects
  gem 'awesome_print'
  # An IRB alternative and runtime developer console
  gem 'pry'
  gem 'pry-byebug'
end

By default rails app is configured to work with SQLite database. But after everything is done the project will be deployed to heroku which prefer PostgreSQL. That is why we specified gem 'pg'.

$ gem install bundler
$ bundle install

After all dependencies are installed, this message will appear:

Bundle complete!

Helpful links