Then simply change gem ‘dm-sqlite-adapter’ in the Gemfile to gem ‘dm-postgres-adapter’ as well as changing DataMapper::setup(:default, “sqlite3://#/smc_form.sqlite”) to DataMapper::setup(:default, ENV) (note, ENV is a environment variable Heroku sets up so that you don’t have to hardcode the DB user, pass, address, and DB name into your code!)Ĭheck out if your DB was created successfully with the following commands: heroku pg:infoįinally, we need to setup and config outgoing mail. First, create the free (dev) Postgres DB addon with Heroku, like so: heroku addons:add heroku-postgresql:dev Next we need to change our app to use Postgres instead of SQLite because Heroku does not support the latter. It will look like this: require './myapp' The other file we need is named “” and is used by Heroku to start the app. Gemfiles can be used with bundler, so you could simply add gems to this file and type “bundle” on the command line and bundler would install missing dependencies for you! The first is a Gemfile, which contains all the gem dependencies of the app. We must create a few files that Heroku requires. This creates a new heroku app and adds a git remote repo to your project. They provide free, bottom tier, developer accounts– perfect for our response form app sample! The first step is to sign up and install the heroku toolbelt command line tools and get logged in by typing: heroku loginĪfter that’s done, deploying the app is a breeze.įirst, cd to the directory of the app, then type heroku create You want this to be publicly accessible on the internet? Enter Heroku, the cloud application platform. Check out PART 1 first if you haven’t already. Here’s part two of an overview guide to using Sinatra, Haml, and Postgres to quickly build a simple inquiry form web app & deploy it to Heroku.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |