This is a template directory for quickly building simple structured Sinatra applications.
The app_example.yml should be copied to app.yml and the appropriate changes made.
$ cp config/app_example.yml config/app.yml
- Ruby 2.4.0
- MySQL 5.7.17 (need to install for client libs)
- MySQL C Connector (if you do not want to install MySQL)
$ gem install bundler
Point bundler to the MySQL configuration tool
$ brew install mysql
$ bundle config build.mysql2 --with-mysql-config=/usr/local/Cellar/mysql/5.7.17/bin/mysql_config
$ brew install mysql-connector-c
$ bundle config build.mysql2 --with-mysql-rpath=/usr/local/lib
In the 'model' directory there is a model name Dummy this should be removed it's an example for building model classes.
Application configuration file app.yml defaults to using the development environment unless the environment variable RACK_ENV is set to a different environment.
$ rackup -s thin -p 4567 -o 0.0.0.0
Running with reload:
$ rerun -- rackup -s thin -p 4567 -o 0.0.0.0
Running reload watching for file changes:
$ rerun --pattern '**/*.{rb,js,coffee,css,scss,sass,erb,html,haml,ru,yml,slim,md,feature}' --notify osx -- rackup -s thin -p 4567 -o 0.0.0.0
$ thin -p 4567 \
--ssl \
--ssl-key-file ~/project/config/self_signed.key \
--ssl-cert-file ~/project/config/self_signed.crt \
--rackup config.ru \
start
Running reload watching for file changes:
$ rerun --pattern '**/*.{rb,js,coffee,css,scss,sass,erb,html,haml,ru,yml,slim,md,feature}' --notify osx -- thin -p 4567 --ssl --ssl-key-file /Users/rbirch/Development/gizmo/gizmo_openemr/config/self_signed.key --ssl-cert-file /Users/rbirch/Development/gizmo/gizmo_openemr/config/self_signed.crt --rackup config.ru start