IMPORTANT COMMANDS - AsadK47/Meet-and-Eat GitHub Wiki

General Heroku fixes

This is a list of the important commands that we have learnt during the process in no particular order. They will be included in the README.md at the end.

  • bundle install
  • rails db:setup
  • rails db:migrate
  • travis encrypt $(heroku auth:token) --add deploy.api_key

If Heroku is acting up and doesn't migrate the databases correctly, which can be checked by running

heroku pg:psql
\dt

then simply run the following command to migrate the database from the schema into Heroku

heroku run rake db:migrate

Alternative options for Heroku:

If you realise that the database on heroku is empty and want to push your local one to the front, then run the following commands below

Heroku pg:reset
heroku pg:push name_of_database_to_be_pushed DATABASE_URL

Running the API Key in credentials (not recommended)

Delete credentials.yml.enc

Paste this into the terminal

EDITOR="atom --wait" rails credentials:edit
  • If need be, replace the editor with one of your choice for example, subl (which is short for sublime text)

In the credentials below secret base type: google_maps_api_key: xxx Replace the x's with either your own API key or ask a member of the team

Warning

This method is not recommended as each time you do a git pull you will need to delete the credentials.yml.enc file and recreate it by running EDITOR="atom --wait" rails credentials:edit and pasting the key in the credentials

Running the API key with the figaro gem (recommended)

To get the api key up and running, please run bundle install which will make sure you have all the gem installed.

Then you will need to run bundle exec figaro install which will create an application.yml file and this file will be automatically .gitignored.

This is important as you will not be pushing this file to github but you can safely add the google api key by copying the code in below.

google_maps_api_key: xxx

Please ask a member of the team for the api key, otherwise you can even use your own if you own one.

Heroku build pack bundler 2.0 error

Use this to reset heroku back to normal buildpack

heroku buildpacks:set https://github.com/heroku/heroku-buildpack-ruby.git

Use this one to upgrade it to 2.0

heroku buildpacks:set https://github.com/bundler/heroku-buildpack-bundler2