To deploy to Heroku, follow these steps:
- Open the Gemfile in your app. Heroku doesn’t support sqlite3 (they support
postgresql) so we have to change that. Remove
gem 'sqlite3'and put it near the bottom under
group :development do
- At the very bottom of Gemfile, type
group :production do
To get this to actually take effect, we need to commit to our repository. We do this by typing this in shell:
bundle install --without production. Then log in to heroku.com and find instructions for installing
curl https://cli-assets.heroku.com/install.sh | sh. I think the piece we are trying to install is called CLI (used to be called Toolbelt?). Type
heroku -v to make sure heroku was installed correctly.
Now log in to heroku using
heroku login. You’ll be redirected to a browser to login. We need to create an application in heroku for our application. To do that, use
heroku create. If you then use
git status you’ll see what hasn’t been committed and what has. Remember to use
git add -a and
git commit -m "whatever you want the message to be" to add the changed files to your commit.
Lastly, we need to add our ssh key to
heroku buildpacks:set https://github.com/bundler/heroku-buildpack-bundler2 but then after that, I was able
git push heroku master
That is completed and here is the site. To rename the site, use the code:
heroku rename new-name-of-site (whatever you want it to be).