Heroku & Git

"Please leave a message at the beep, we will get back to you when your support contract expires."

Moderators: phlip, Moderators General, Prelates

User avatar
SpringLoaded12
Posts: 350
Joined: Wed Oct 08, 2008 1:58 am UTC
Location: Guarding the Super Missile
Contact:

Heroku & Git

Postby SpringLoaded12 » Tue Jun 03, 2014 9:21 pm UTC

I'm doing a project that involves using Heroku to host a postgresql database and a webpage to go with it, but at the moment I'm struggling with an early step.

I've successfully created a Heroku app and looking at help displays a lot of the commands I'll need to use, but all of them require me to specify an app and I can't find the command to do that anywhere in the documentation or in the web guides. How do I specify an app?

I suspect this is the first of many steps I'll get stuck on in this process.
"It's easy to forget what a sin is in the middle of a battlefield." "Opposite over hypotenuse, dipshit."

User avatar
felltir
has a sniper scope and a trigger finger.
Posts: 2493
Joined: Tue Mar 04, 2008 5:01 pm UTC
Location: Back in't home town. Never at home.
Contact:

Re: Heroku & Git

Postby felltir » Wed Jun 04, 2014 10:58 am UTC

Spoiler:
RoadieRich wrote:He's a super flexible furry martial artist from London. She is a Rabbit breeding mad scientist from Michigan. They fight crime!
The Great Hippo wrote:I THINK THE SOLAR SYSTEM MIGHT BE AN ATOM OF OXYGEN.


Blog

he/him/his

User avatar
SpringLoaded12
Posts: 350
Joined: Wed Oct 08, 2008 1:58 am UTC
Location: Guarding the Super Missile
Contact:

Re: Heroku & Git

Postby SpringLoaded12 » Fri Jun 06, 2014 9:45 pm UTC

Well that seems to be working, but I think my problem is a bit bigger; I'm having trouble wrapping my head around what I'm trying to do, and all I have to guide me is documentation I can look up, when what I really need is a better conceptual understanding.

What exactly does a Heroku app do? What does hosting on Heroku provide that just doing things locally doesn't? What exactly is Git, what's a repository, and why do I apparently need one?

But most importantly, since it seems I'm supposed to build this database locally and then push it to the Heroku app, now that I've created an empty database, how do I define the parameters for its entries so that I can start adding entries to it?
"It's easy to forget what a sin is in the middle of a battlefield." "Opposite over hypotenuse, dipshit."

User avatar
ahammel
My Little Cabbage
Posts: 2135
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC
Contact:

Re: Heroku & Git

Postby ahammel » Sat Jun 07, 2014 1:14 am UTC

SpringLoaded12 wrote:What exactly does a Heroku app do? What does hosting on Heroku provide that just doing things locally doesn't? What exactly is Git, what's a repository, and why do I apparently need one?

You may want to take my Heroku advice with a grain of salt, add my entire experience with it consists of having hung out with some of their devs once. Never the less:

Heroku gives you a server. The app lives on a machine that Heroku administers, rather than one that your company controls. This can be a good thing if you don't have the money, expertise, or inclination to maintain a server farm yourself. Heroku evidently also provides various add-on pieces of software that you can integrate with a web-app if you so desire.

Git is a version control system. A repository is a bunch of code lumped together with a common version history. You need one because you get your app into Heroku's server by sticking it in a git repository and performing an operation called a "push".

Try git immersion if you want to get a handle on how git thinks.
He/Him/His/Alex
God damn these electric sex pants!

User avatar
SpringLoaded12
Posts: 350
Joined: Wed Oct 08, 2008 1:58 am UTC
Location: Guarding the Super Missile
Contact:

Re: Heroku & Git

Postby SpringLoaded12 » Sun Jun 08, 2014 10:35 pm UTC

It seems the problems just keep coming.

I finally got the database working and added a table with the desired entries, but now I need to push it to the Heroku app, onto a database I created there. This has introduced two errors:
1. Pointing the CLI to the directory path of the local database, which will also require me to find the local database
2. Resetting the apparently non-empty remote database

As shown here, even after resetting, it still claims to be non-empty:

Image

The next big hurdle is getting a Ruby program working that will query the server and send the resulting info to the webpage.
"It's easy to forget what a sin is in the middle of a battlefield." "Opposite over hypotenuse, dipshit."

User avatar
SpringLoaded12
Posts: 350
Joined: Wed Oct 08, 2008 1:58 am UTC
Location: Guarding the Super Missile
Contact:

Re: Heroku & Git

Postby SpringLoaded12 » Mon Jun 09, 2014 5:16 pm UTC

Okay, let's make this a little easier:

Once I have a Ruby script query the server and receive info from the table, how does that info go from the Ruby script to a webpage? That's the end goal: a webpage with a Javascript form that allows the end user to select one of the listings from the database, at which point they'll make another selection from within that listing's other attributes, and then the webpage will display a paragraph of text based on the info from the listing.
"It's easy to forget what a sin is in the middle of a battlefield." "Opposite over hypotenuse, dipshit."

User avatar
felltir
has a sniper scope and a trigger finger.
Posts: 2493
Joined: Tue Mar 04, 2008 5:01 pm UTC
Location: Back in't home town. Never at home.
Contact:

Re: Heroku & Git

Postby felltir » Tue Jun 10, 2014 6:17 am UTC

SpringLoaded12 wrote:Okay, let's make this a little easier:

Once I have a Ruby script query the server and receive info from the table, how does that info go from the Ruby script to a webpage? That's the end goal: a webpage with a Javascript form that allows the end user to select one of the listings from the database, at which point they'll make another selection from within that listing's other attributes, and then the webpage will display a paragraph of text based on the info from the listing.


I would say that Sinatra is the most lightweight thing I know of for doing what you want.

ahammel wrote:
SpringLoaded12 wrote:What exactly does a Heroku app do? What does hosting on Heroku provide that just doing things locally doesn't? What exactly is Git, what's a repository, and why do I apparently need one?

You may want to take my Heroku advice with a grain of salt, add my entire experience with it consists of having hung out with some of their devs once. Never the less:

Heroku gives you a server. The app lives on a machine that Heroku administers, rather than one that your company controls. This can be a good thing if you don't have the money, expertise, or inclination to maintain a server farm yourself. Heroku evidently also provides various add-on pieces of software that you can integrate with a web-app if you so desire. *SNIP*


I've worked quite a lot with Heroku, and that's definitely a good explanation.
Spoiler:
RoadieRich wrote:He's a super flexible furry martial artist from London. She is a Rabbit breeding mad scientist from Michigan. They fight crime!
The Great Hippo wrote:I THINK THE SOLAR SYSTEM MIGHT BE AN ATOM OF OXYGEN.


Blog

he/him/his

User avatar
SpringLoaded12
Posts: 350
Joined: Wed Oct 08, 2008 1:58 am UTC
Location: Guarding the Super Missile
Contact:

Re: Heroku & Git

Postby SpringLoaded12 » Tue Jun 10, 2014 9:59 pm UTC

felltir wrote:I would say that Sinatra is the most lightweight thing I know of for doing what you want.

This looks like exactly what I need! Thank you. I seem to be having trouble installing it though.
I installed RubyGems and then put

Code: Select all

gem install sinatra

into IRB, but it's still giving me the same error message as from before I installed RubyGems. Maybe I installed it wrong?

EDIT: This is a serious problem. I can't install Rails either.

Code: Select all

gem list

Also doesn't work. Any ideas?

EDIT: Well fuck, I thought I was supposed to enter this stuff into IRB. Just discovered that the Ruby installation included "Start Command Prompt with Ruby," which is where I need to enter these things. Problem solved.
"It's easy to forget what a sin is in the middle of a battlefield." "Opposite over hypotenuse, dipshit."

User avatar
felltir
has a sniper scope and a trigger finger.
Posts: 2493
Joined: Tue Mar 04, 2008 5:01 pm UTC
Location: Back in't home town. Never at home.
Contact:

Re: Heroku & Git

Postby felltir » Sat Jun 21, 2014 9:12 pm UTC

Glad you got it all worked out (or so it seems)
Spoiler:
RoadieRich wrote:He's a super flexible furry martial artist from London. She is a Rabbit breeding mad scientist from Michigan. They fight crime!
The Great Hippo wrote:I THINK THE SOLAR SYSTEM MIGHT BE AN ATOM OF OXYGEN.


Blog

he/him/his


Return to “The Help Desk”

Who is online

Users browsing this forum: No registered users and 5 guests