Forum: Ruby on Rails Using PostgreSQL with RoR on windows. Help!

Posted by Tak G. (tak_g)
on 2012-09-21 19:45
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 :-/
http://railscasts.com/episodes/342-migrating-to-po...

 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.
Posted by Greg Akins (akinsgre)
on 2012-09-21 20:04
(Received via mailing list)
On Fri, Sep 21, 2012 at 1:45 PM, Tak G. <lists@ruby-forum.com> 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 :-/
> http://railscasts.com/episodes/342-migrating-to-po...
>
>  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 Akins
http://twitter.com/akinsgre
Posted by Tak G. (tak_g)
on 2012-09-21 20:08
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.
Posted by Greg Akins (akinsgre)
on 2012-09-21 20:15
(Received via mailing list)
I

On Fri, Sep 21, 2012 at 2:08 PM, Tak G. <lists@ruby-forum.com> 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 Akins
http://twitter.com/akinsgre
Posted by Hassan Schroeder (Guest)
on 2012-09-21 20:23
(Received via mailing list)
On Fri, Sep 21, 2012 at 11:08 AM, Tak G. <lists@ruby-forum.com> 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 Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Posted by Tak G. (tak_g)
on 2012-09-21 20:34
Hassan Schroeder wrote in post #1077004:
> On Fri, Sep 21, 2012 at 11:08 AM, Tak G. <lists@ruby-forum.com> 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 Schroeder ------------------------ hassan.schroeder@gmail.com
> http://about.me/hassanschroeder
> 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
Posted by Hassan Schroeder (Guest)
on 2012-09-21 20:48
(Received via mailing list)
On Fri, Sep 21, 2012 at 11:34 AM, Tak G. <lists@ruby-forum.com> 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. :-)

Good luck.
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Posted by Tak G. (tak_g)
on 2012-09-21 21:34
Hassan Schroeder wrote in post #1077008:
> On Fri, Sep 21, 2012 at 11:34 AM, Tak G. <lists@ruby-forum.com> 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. :-)
>
> Good luck.
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
> http://about.me/hassanschroeder
> 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?
Posted by Greg Akins (akinsgre)
on 2012-09-21 21:36
(Received via mailing list)
On Fri, Sep 21, 2012 at 2:34 PM, Tak G. <lists@ruby-forum.com> 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 Akins
http://twitter.com/akinsgre
Posted by Greg Akins (akinsgre)
on 2012-09-21 21:40
(Received via mailing list)
On Fri, Sep 21, 2012 at 3:34 PM, Tak G. <lists@ruby-forum.com> 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 Akins
http://twitter.com/akinsgre
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.