You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/deployment/heroku-deployment.md
+140-1Lines changed: 140 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,26 @@
1
1
# Heroku Deployment
2
2
3
+
> **Note:** This guide is based on the working tutorial app at [reactrails.com](https://reactrails.com). While the instructions work, some versions referenced are older. For current Heroku best practices with Rails 7, see [Heroku's Rails 7 Guide](https://devcenter.heroku.com/articles/getting-started-with-rails7).
4
+
5
+
## Create Your Heroku App
6
+
7
+
_Assuming you can log in to heroku.com and have logged into your shell for Heroku._
8
+
9
+
1. Visit [https://dashboard.heroku.com/new](https://dashboard.heroku.com/new) and create an app, say named `my-name-react-on-rails`:
Run this command that looks like this from your new Heroku app
14
+
15
+
```bash
16
+
heroku git:remote -a my-name-react-on-rails
17
+
```
18
+
3
19
## Heroku buildpacks
4
20
5
21
React on Rails requires both a ruby environment (for Rails) and a Node environment (for Webpack), so you will need to have Heroku use multiple buildpacks.
6
22
7
-
Assuming you have downloaded and installed the Heroku command-line utility and have initialized the app, you will need to tell Heroku to use both buildpacks via the command-line:
Next, configure your app for Puma, per the [instructions on Heroku](https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server).
97
+
98
+
Create `./Procfile` with the following content. This is what Heroku uses to start your app.
99
+
100
+
```
101
+
web: bundle exec puma -C config/puma.rb
102
+
```
103
+
104
+
Note, newer versions of Rails create this file automatically. However, the [docs on Heroku](https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#config) have something a bit different, so please make it conform to those docs. As of 2020-06-04, the docs looked like this:
0 commit comments