Skip to content

Backend Setup Guide #3

Description

@davidnuna
  1. Clone the repository.
  2. Install ruby, rails and postgresql 9.6 -> check how based on OS.
  3. Install rvm -> https://rvm.io/rvm/install
  4. Create a new file in RestaurantApp/backend called .rvmrc and paste the following into it:
rvm use 3.0.0@backend --create
  1. Command cd . for the correct ruby version to take effect (press Y when prompted).
  2. Command bundle install to install all the dependencies (if something failse do bundle update instead)
  3. Open the project and create a new file in the config folder called database.yml and paste into it the following code:
default: &default
  adapter: postgresql
  encoding: unicode
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

development:
  <<: *default
  database: backend_development

test:
  <<: *default
  database: backend_test

production:
  <<: *default
  database: backend_production
  username: backend
  password: <%= ENV['BACKEND_DATABASE_PASSWORD'] %>

  1. In the config/initializers folder create a new file a_env.rb and paste the following line into it:
ENV['DEVISE_JWT_SECRET_KEY'] = "4bff4ae8f2b386386e7b19e860e09e36580d8aea8dbd6b860dc261e9526d1f8610653c6f5f2c12d731beebd0ef47b48b3e968bdc1efc4111c2521766641dc299"
  1. To run the migrations use the following command -> rails db:migrate (if it fails use rails db:setup instead).
  2. Run the server with the command rails s or the rails console using rails c.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions