⬆️Heroku Deploy
We currently use Heroku for deploying to production but LightningRails works with other popular options as well. We will add a guide to other ones very soon.
To install Heroku CLI in your terminal, follow these instructions:
macOS installation
⚠️ If you get this error:
Execute this command:
Ubuntu installation
Login
Signin from the terminal to be able to push directly from the terminal
Create your heroku app
To create an app and automatically connect it to your current directory of code through the GitHub remotes:
It's important to set the correct region, otherwise your methods like Time.now will have the wrong time zone, plus you might get in trouble down the line with cookies and users data storage 🍪
Push to production
After committing your last line of code, you can now push to production with a simple command
Migrate your database
Remember that your development database is only in your computer and stored locally, heroku in turn is in the cloud, which means it will have a different database, that you must migrate and seed.
Credential variables
Along the same lines as we set our API keys in our credentials file and .env file, you must set it to your production environment
Stripe credentials
You will need to go to your stripe dashboard and toggle the "Live" button, to access the live api keys "developers" > API. Once done, copy the keys in your terminal with the following command to
You will also need to create a webhook under "Webhooks":
Click on "add an endpoint"
Add the endpoint url:
"https://example.org/pay/webhooks/stripe"
Select events: Charge + checkout
Copy the key and paste it in your terminal with the following command
Error Handling in Heroku
If you run into an error when opening your app in the browser with
You will need to investigate by looking at the logs
Last updated