Wit pratical test
You can choose use the traditional installation or use the project with Docker.
Install RVM: see RVM installation guide.
$ rvm install ruby-2.4.2
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
$ gem install bundler --no-ri --no-rdoc
$ bundle install
Ubuntu 16.10
$ sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main"
$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install postgresql-9.6
Or see PostgreSQL installation WIKI.
$ cp -pRfv .env.production.sample .env.production
$ cp -pRfv .env.development.sample .env.development
$ cp -pRfv .env.test.sample .env.test
Update your .env.prouction, .env.development or .env.test if necessary.
$ bundle config build.pg --with-pg-config=/path/to/pg_config
$ bundle exec rake db:create
$ bundle exec rake db:migrate
$ bundle exec rails s -b 0.0.0.0
Configure the database tests
$ RAILS_ENV=test bundle exec rake db:create && bundle exec rake db:migrate && bundle exec rake db:test:prepare
Rspec
$ bundle exec rspec
Install Docker here
Build images:
$ make rebuild
Create databases:
make docker-createdb
Start the application:
$ make up
If you need use another instance of application in Docker (for run the rails console for example):
make bash
To finish all Docker instances:
$ make down
Access: http://localhost:3000
pgAdmin4: http://localhost:5050