Heroku Setup on c9

Okay, so I’ve finally got the time to dive deep into https://www.railstutorial.org/book/, and I’m already slightly annoyed or confused… (section 1.5.1)

So most of the time the author is really good about telling you what directory you need to be in to run a command, but then he just went blank. So do I run the heroku create inside the hello_app/ or do I run it within workspaces/?

I’m assuming hello_app, but only because that is the actual application. That also assumes, I’d run this command for any future application too, but since i have no idea what I’m doing, I’m doubting myself.

Anyone know if that is indeed the appropriate place to run the heroku create command?

Inside hello_app.

I’m not sure which comes first - git repository create or heroku create. I think git comes first.

I’ve been working through that book for a while now.

I’m about 99% sure it’s within the hello_app. I’ve done it like 3-4 times but I just restarted it again for like the 5th time yesterday and I’m JUST below the part about heroku.

So it ends up, I think I have to destroy my workspace :frowning:

As I setup a blank repo for this on github first and then cloned it in c9, then the book had me create a new folder and wanted that folder to be the root of git, which it isn’t :frowning: and that is what is making heroku refusing to run properly.

sigh

If you are using C9, you don’t need to create a folder called workspaces. ( https://www.railstutorial.org/book/beginning#sec-the_hello_application ) After you provision the workspace in C9, just create a new Rails app and follow the instructions and ignore the bit about creating a workspaces folder. You only need to do that if you are developing on your local machine.

As far as the heroku commands, I think that you’ll want to run those in the root of your app. In this case it would be the hello_app folder.

Also, post any errors you’re receiving when you run heroku commands and we’ll see if we can figure this out. :smile:

Well, I know I didn’t need to create the workspaces folder :smile:

Here is where I went wrong.

  1. I created a repo on Github called railstutorial
  2. I cloned that repo on c9 and started my workspace
  3. I created a folder hello_app (per the tutorial)
  4. Since my workspace is already associated to github, I simply ran the git commands to add hello_app to the existing repo

Because of that, the “root” of the repo was one folder above hello_app. heroku doesn’t like that. It wants the app to be the root.

Once I cleared my workspace and started over, all went smoothly (first lesson learned )

For future reference, the error I was receiving was (which I didn’t have on my initial post because I hadn’t run the command yet :slight_smile: )

**-----> Heroku receiving push
 !     Heroku push rejected, no Cedar-supported app detected**

Why are you not just going to C9 and creating a new workspace from the Rails Tutorial section? You’re doing it differently than I did :slight_smile: .

Well, I did and didn’t. Primarily because I knew I wanted to put my code in github so I could work it outside of c9 should I want to.

Once I realized heroku required the app to be the root, I saw the error of my ways and created the workspace in c9 first, and then added github as a remote to my apps afterwards. That allowed me to accomplish my goal of making sure I can get to my code outside of c9. :smile:

I’ve now completed Chapter 2 successfully. My goal is to tackle 3 and 4 later tonight :smile:

You can also push your code up on github. I believe the tutorial goes over pushing it up on there? I push on heroku and git. Simple.

Good job fixing it though.

Just finished Chapter 2 as well again. I’m going to pick it up again tomorrow as well. Perhaps we could consult each other if we get stuck on a particular section. Have a second set of eyes/brain to pick up on stuff.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.