Skip to content

Commit

Permalink
Remove use of heroku-buildpack-multi since heroku supports multiple b…
Browse files Browse the repository at this point in the history
…uildpacks natively.
  • Loading branch information
esauter5 committed Mar 8, 2016
1 parent 79eb432 commit 273488c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
10 changes: 4 additions & 6 deletions docs/additional_reading/heroku_deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,22 @@
The generator has created the necessary files and gems for deployment to Heroku. If you have installed manually, you will need to provide these files yourself:

+ `Procfile`: used by Heroku and Foreman to start the Puma server
+ `.buildpacks`: used to install Ruby and Node environments
+ `12factor` gem: required by Heroku
+ `'puma'` gem: recommended Heroku webserver
+ `config/puma.rb`: Puma webserver config file
+ `lib/tasks/assets.rake`: This rake task file is provided by the generator regardless of whether the user chose Heroku Deployment as an option. It is highlighted here because it is helpful to understand that this task is what generates your JavaScript bundles in production.

## How to Deploy

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. Currently, we would suggest using [DDollar's Heroku Buildpack Multi](https://github.com/ddollar/heroku-buildpack-multi).
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.

Assuming you have downloaded and installed the Heroku command-line utility and have initialized the app, you will need to tell Heroku to use Heroku Buildpack Multi via the command-line:
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:

```
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-multi
heroku buildpacks:set heroku/ruby
heroku buildpacks:add --index 1 heroku/nodejs
```

Heroku will now be able to use the multiple buildpacks specified in `.buildpacks`.

For more information, see [Using Multiple Buildpacks for an App](https://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app)

## Fresh Rails Install
Expand Down
5 changes: 3 additions & 2 deletions docs/tutorial-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ Run this command that looks like this from your new heroku app

heroku git:remote -a my-name-react-on-rails

Set the correct buildpack for using react-on-rails:
Set heroku to use multiple buildpacks:

heroku buildpacks:set https://github.com/heroku/heroku-buildpack-multi
heroku buildpacks:set heroku/ruby
heroku buildpacks:add --index 1 heroku/nodejs


### Swap out sqlite for postgres by doing the following:
Expand Down
3 changes: 1 addition & 2 deletions lib/generators/react_on_rails/heroku_deployment_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ class HerokuDeploymentGenerator < Rails::Generators::Base

def copy_heroku_deployment_files
base_path = "heroku_deployment"
%w(.buildpacks
Procfile
%w(Procfile
config/puma.rb).each { |file| copy_file("#{base_path}/#{file}", file) }
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
shared_examples "heroku_deployment" do
it "should add heroku deployment files" do
assert_file("Procfile")
assert_file(".buildpacks")
end

it "should add heroku production gems" do
Expand Down

0 comments on commit 273488c

Please sign in to comment.