Simple Rails API that needs some devop stuff on it
- Have RVM installed: https://letmegooglethat.com/?q=install+rvm+on+ubuntu
- Install ruby:
$ rvm install 3.0.2
$ cd .
or$ cd <path_to_project>
to auto-create the rvm gemset- Install the dependencies:
$ bundle install
- Ensure the db is running on port 5432
- Setup development & test DBs:
$ rails db:setup
- Fill with some data:
$ rails db:seed
- Ensure the db is running on port 5432
- Start the app:
$ rails s
- Test/play with:
$ curl -v http://localhost:3000/ping; echo
- Ensure the db is running on port 5432
$ rspec
$ rubocop
Database credentials are set in config/database.yml, but Rails can take also the db connection string from DATABASE_URL env variable