Boilerplate Sinatra app that includes:
- Heroku-Ready
- User Registration
- Sendmail using GMail and Sendgrid
- Warden Authentication
Install this codebase
Make sure you're using Ruby 2.2.5. If not, review this article on how to upgrade Ruby on Mac OS X using rbenv
ruby -v
Update gem –the package manager we're going to use.
sudo gem update
Update all the app packages found in Gemfile
.
sudo gem install bundler
Install all the app specific packages
bundle install --without production
Start your web server (using Procfile + Foreman )
gem install foreman
foreman start
Install Heroku
sudo gem install heroku
heroku login
If you need a local SQL database, you'll need to pick PostGres
git remote -v
heroku apps
heroku git:remote -a [name of app on heroku]
bundle install --without production
git push heroku master
First register your database by finding and promoting it
irb
require './app'
DataMapper.auto_migrate!
First register your database by finding and promoting it
heroku pg
heroku pg:promote [HEROKU_POSTGRESQL_NAME_OF_DATABASE]
heroku run console
require './app'
DataMapper.auto_migrate!
Use Homebrew to install SQLite
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew install sqlite
gem install sqlite
- Gemfile is used to store all the libraries and dependencies you'll need to launch and deploy your app.
- Procfile is the process file you used to kickstart your app.
- Foreman is the toolkit you use to automatically start-up your server
- SQLite is what you'll use for a local SQl database
- Postgresql is the SQL database you'll use for production
- config.ru is the configuration file that connect Procfile to your initial app.rb file.
Add the property within the class
property :likes, Integer, :default => 0
Use IRB to migrate the database
bash$ irb
Use DataMapper to update the tables
DataMapper.auto_upgrade!
Test out your work
bash$ irb
require './app'
bash$ song = Song.first
bash$ song.likes
heroku run console
require './main'
DataMapper.auto_upgrade!
- Authentication w/ Warden
- Facebook authentication with koala
- twitter authentication
- Simple Facebook authentication
- Basic Sinatra Authentication
- Install a raw Boilerplate Sinatra codebase
Web server errors Find out if any servers are running 'headless'
ps aux | grep ruby
Quit any 'headless' running servers
kill -9 xxxxxx
heroku logs