An eCommerce store written in Ruby on Rails.
Before you try to run the application make sure you
- have a Ruby version
2.6.3
installed - have PostgreSQL driver
pg
installed
To install specific version of Ruby you can use RVM or rbenv.
First, you must create the PostgreSQL role that will be used to create and manage the application's database.
Within the PostgreSQL interactive terminal, type the following:
create role fire_coold with createdb login password '<your-password>';
This statement will create a role fire_coold
with abilities to login, create a
database and with the password you provide.
If you take a look at the file config/database.yml
there is a section named default
where the password
key has been set to
<%= ENV['FIRE_COOLD_DATABASE_PASSWORD'] %>
This means that the environment must contain a variable named FIRE_COOLD_DATABASE_PASSWORD
.
To achieve that we can add this line within the startup file of your shell (.bashrc
, .zshrc
or similar file depending on the shell you use):
export FIRE_COOLD_DATABASE_PASSWORD=<your-password>
While being in the project directory, execute
bundle install
to install gems from the Gemfile
.
There is one step left before we can run the application server - we must prepare our database. To do that run the rake tasks with the command
rake db:create db:migrate db:seed
To start the application server run
rails s
By default the application will be accessible on localhost:3000/
.