Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Location of app when pushed to Heroku

I have a Rails project under git.

The structure is:

SomeProject
    -Docs
    -Src
        -Rails

Rails is the root of the rails application, but SomeProject is the root of the repo.

When I try and push to Heroku I get:

Heroku push rejected, no Cedar-supported app detected

So my questions are:

  1. Would this be resulting because the rooot of the repo and the root of the Rails application are different?

  2. If so is there a way I can tell Heroku where the root of the Rails application is?

  3. If not what else would cause this problem?

like image 477
Undistraction Avatar asked Dec 05 '25 13:12

Undistraction


2 Answers

This is not an ideal situation, especially for heroku, but the generally accepted solution is pretty straightforward. It will take a bit of work on your behalf, but nothing too bad.

  1. Create two repositories, one for the rails app, and one for "SomeProject."

  2. Add your rails app as a submodule to "SomeProject." You can add them pretty easily, using something like git submodule add [email protected]:user/rails_app/ rails. This will add the rails application as a submodule to your project, so it's essentially it's own repository. Find more information here.

  3. Add heroku as a remote to the submodule, and when you want to deploy the app, push from the submodule, rather than the entire project.

This is not as easy as git push heroku master:'/rails', but nothing like that exists (yet, anyway).

Hope this helps!

like image 140
andrewpthorp Avatar answered Dec 07 '25 03:12

andrewpthorp


The easiest solution is to split out your Rails application into its own repository, as andrewpthorp suggests.

Another solution is to write your own buildpack in a separate repository, based on heroku/heroku-buildpack-ruby but customized to support your alternate project layout, and use that to deploy your application.

like image 40
yfeldblum Avatar answered Dec 07 '25 04:12

yfeldblum



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!