This is a barebones implementation of Sinatra with ActiveRecord. This is a simplified way of creating a web app simply for CRUD operations and static websites that you might want to add functionality to later.
bundle install
to install gems- edit database.yml (set to db parameters)
- edit models as needed
- run
rake db:create_migration NAME=create_model
(db folder gets created with migrations) - run
rake db:create
(this might not work, might have to manually create the db usingcreatedb
in bash) - run
rake db:migrate
- create an .env file with
RACK_ENV=production
(or whatever environment) ruby app.rb
to run the app locally
Inspired from these tutorials
For my Webfaction server, make sure the following are done when SSH'd:
- Enter
export GEM_HOME=$PWD/gems
and press Enter. - Enter
export RUBYLIB=$PWD/lib
and press Enter. - Enter
export PATH=$PWD/bin:$PATH
and press Enter.