Using PostgreSQL with RoR on windows. Help!

So I just got involved in a huge team project with RoR and PostgreSQL.
But I can’t find anywhere on the internet to find a proper way to put
them together. I did find one but it is for iOS :-/

I have them both installed and the gem package for postgres also. the
database.yml is already configured. I just don’t know where to go from
here. any help would be great thanks.

On Fri, Sep 21, 2012 at 1:45 PM, Tak G. [email protected] wrote:

So I just got involved in a huge team project with RoR and PostgreSQL.
But I can’t find anywhere on the internet to find a proper way to put
them together. I did find one but it is for iOS :-/
#342 Migrating to PostgreSQL - RailsCasts

I have them both installed and the gem package for postgres also. the
database.yml is already configured. I just don’t know where to go from
here. any help would be great thanks.

You say you have them installed, but don’t know where to go next? What is
it you’re missing? Postgres, from a RoR perspective, isn’t any
different
than sqlite or mysql. You use migrations and ActiveRecord in the same
way.

Perhaps you can be more specific about what you’re trying to do, and
where
you are having troubles.


Greg A.
http://twitter.com/akinsgre

Okay, all I am trying to do is get the web app for the project to start.
i’ve never done anything with database though which is why i’m kind of
stuck.

I

On Fri, Sep 21, 2012 at 2:08 PM, Tak G. [email protected] wrote:

Okay, all I am trying to do is get the web app for the project to start.
i’ve never done anything with database though which is why i’m kind of
stuck.

Is the database started and can you access it using psql.

If the database is started and the database.yml is configured correctly,
you should be able to run db:create and db:migrate


Greg A.
http://twitter.com/akinsgre

On Fri, Sep 21, 2012 at 11:08 AM, Tak G. [email protected] wrote:

Okay, all I am trying to do is get the web app for the project to start.

Are you saying you don’t know how to start a Rails app?

Sounds like a basic tutorial would be a good place to begin.


Hassan S. ------------------------ [email protected]

twitter: @hassan

On Fri, Sep 21, 2012 at 11:34 AM, Tak G. [email protected] wrote:

i mean i know the very basic, which is to just type in rail s. All i’ve
done with rail is start a web app without a db. I don’t know anything
about creating a db and then migrating

Then you need to learn that first.

I was told to use the following
commands, but since I’m using a windows I cant use these commands

postgres -D /usr/local/var/postgres

Do you understand what that command does? If so, you should have
no problem adapting it to your environment. Though if the rest of the
developers are using *nix systems, you would probably be better off
following their lead. :slight_smile:

Good luck.

Hassan S. ------------------------ [email protected]

twitter: @hassan

Hassan S. wrote in post #1077004:

On Fri, Sep 21, 2012 at 11:08 AM, Tak G. [email protected] wrote:

Okay, all I am trying to do is get the web app for the project to start.

Are you saying you don’t know how to start a Rails app?

Sounds like a basic tutorial would be a good place to begin.


Hassan S. ------------------------ [email protected]
Hassan Schroeder | about.me
twitter: @hassan

i mean i know the very basic, which is to just type in rail s. All i’ve
done with rail is start a web app without a db. I don’t know anything
about creating a db and then migrating but I think theres something else
that has to be done prior to it. I was told to use the following
commands, but since I’m using a windows I cant use these commands

postgres -D /usr/local/var/postgres
psql theprojectname
CREATE ROLE cstarleague PASSWORD ‘secret’ LOGIN SUPERUSER;
and then migrate the db

Hassan S. wrote in post #1077008:

On Fri, Sep 21, 2012 at 11:34 AM, Tak G. [email protected] wrote:

i mean i know the very basic, which is to just type in rail s. All i’ve
done with rail is start a web app without a db. I don’t know anything
about creating a db and then migrating

Then you need to learn that first.

I was told to use the following
commands, but since I’m using a windows I cant use these commands

postgres -D /usr/local/var/postgres

Do you understand what that command does? If so, you should have
no problem adapting it to your environment. Though if the rest of the
developers are using *nix systems, you would probably be better off
following their lead. :slight_smile:

Good luck.

Hassan S. ------------------------ [email protected]
Hassan Schroeder | about.me
twitter: @hassan

sigh this is becoming a huge hassle. the rest of the developers are
using nix or a mac. why does it matter if i use a windows or a nix?

postgres -D starts up postgres right?

On Fri, Sep 21, 2012 at 2:34 PM, Tak G. [email protected] wrote:

postgres -D /usr/local/var/postgres
psql theprojectname
CREATE ROLE cstarleague PASSWORD ‘secret’ LOGIN SUPERUSER;
and then migrate the db

This isn’t Rails… it’s basic Postgres for 1) Starting the server, 2)
using
the commandline tool for executing database commands (SQL) and 3)
creating
a user that will be specified in the database.yml

If you can’t get this far, you need to start with a Postgres for Windows
tutorial.


Greg A.
http://twitter.com/akinsgre

On Fri, Sep 21, 2012 at 3:34 PM, Tak G. [email protected] wrote:

sigh this is becoming a huge hassle. the rest of the developers are
using nix or a mac. why does it matter if i use a windows or a nix?

Because RoR on Windows is painful. It just doesn’t seem to be supported
as
well. You can do it, lots of people have; but most people doing RoR
seem
to be using Linux or Mac OS X. And all the advice, tutorials and help
from
your fellow developers are going to be biased in that direction.

postgres -D starts up postgres right?

Yep; though on Windows Postgres can be installed as a Service that is
started through Windows Service Manager much like other Windows
processes
that are meant to run in the background.


Greg A.
http://twitter.com/akinsgre