0

This is my dir tree rails-tutorial/ hello_app

I tried to deploy the hello rails app to heroku, but it failed as heroku could not recognize the rails app. So I had to move the contents of the rails app to the root folder(in this case rails-tutorial). It then worked.

Now, I want to create a new app. When I try to create it in the root folder it says "Can't initialize a new Rails application within the directory of another, please change to a non-Rails directory first."

What do I do? If I push all the contents into a dir, heroku is not able to recognize it as an app.

PRK
  • 9
  • 1
  • 5
  • 2
    move your files back to ``hello_app``. Enter into your directory. ( If linux, ``cd hello_app`` ) . Then ``git push heroku ``. Now you can move back to ``rails_tutorial`` and create you new app. – raj Nov 30 '16 at 12:50
  • You can deploy a subfolder using something like this: https://coderwall.com/p/ssxp5q/heroku-deployment-without-the-app-being-at-the-repo-root-in-a-subfolder – tegon Nov 30 '16 at 13:15

1 Answers1

0

When you push to heroku, make sure, you are at the root of project, here is hello_app.

In your case rails-tutorial/hello_app, you are at folder rails-tutorial, you must be move to hello_app, just type cd hello_app on terminal

You can't create a new rails app inside another. Move out of current rails project, and create other.

In this case. I think, you should move all content of project hello_app to folder hello_app under rails-tutorial. Them create new rails app sample new_app under rails-tutorial

rails-tutorial    
|__ hello_app
    |__app
    |__bin
    |__config
    |__db
    |__etc...

|__ new_app
    |__app
    |__bin
    |__config
    |__db
    |__etc...
Duyet Nguyen
  • 543
  • 3
  • 11