Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove use of heroku-buildpack-multi #319

Merged
merged 1 commit into from
Mar 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/additional_reading/heroku_deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
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)

If for some reason you need custom buildpacks that are not officially supported by Heroku ([see this page](https://devcenter.heroku.com/articles/buildpacks)), we recommend checking out [heroku-buildpack-multi](https://github.com/ddollar/heroku-buildpack-multi).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the one you want: https://github.com/heroku/heroku-buildpack-multi


## Fresh Rails Install

### Swap out sqlite for postgres by doing the following:
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to delete the .buildpacks file also.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh good catch! That file was hiding from me because it was a dot file.

config/puma.rb).each { |file| copy_file("#{base_path}/#{file}", file) }
end

Expand Down

This file was deleted.

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