Обсуждение: ruby connect

Поиск
Список
Период
Сортировка

ruby connect

От
Justin Carrera
Дата:

 

Hi, 

 

I’m trying to connect ruby to postgres on ubuntu and the only link I found that has the library is down.  Does anyone have the postgres library for ruby?  Or direct me to it?

 

 

Re: ruby connect

От
Richard Huxton
Дата:
Justin Carrera wrote:
> Hi,
>
> I'm trying to connect ruby to postgres on ubuntu and the only link I
> found that has the library is down.

Details of the link might have helped the other readers on this list.
The owner might not know.

> Does anyone have the postgres
> library for ruby?  Or direct me to it?

I think this is the current project:
   http://rubyforge.org/projects/ruby-pg/

It would help if it came up prominently on searches for "postgresql" though.

--
   Richard Huxton
   Archonet Ltd

Re: ruby connect

От
Richard Huxton
Дата:
Justin Carrera wrote:
> I will remember that for next time.
>
> Thank you for the link.
>
> I tried installing the gem but unsuccessful...
>
> root@CodeHo:/home/justin/Documents/ruby# gem install postgres -- --with-pgsql-include=/opt/PostgreSQL/8.3/include
--with-pgsql-lib=/opt/PostgreSQL/8.3/lib
> Building native extensions.  This could take a while...
> ERROR:  Error installing postgres:
>         ERROR: Failed to build gem native extension.
>
> /usr/bin/ruby1.9 extconf.rb install postgres -- --with-pgsql-include=/opt/PostgreSQL/8.3/include
--with-pgsql-lib=/opt/PostgreSQL/8.3/lib
> extconf.rb:4:in `<main>': uninitialized constant PLATFORM (NameError)

I'm afraid I don't use ruby, so I can't provide specific advice.
However, this looks to me like the gem installer expects a PLATFORM
(e.g. "linux") to be defined and can't find it. I'd expect there is a
guide to setting up your gems environment somewhere on the ruby pages
though.

However, before you spend too long with this - are you sure there isn't
an Ubuntu package for this? A few seconds' searching suggests this might
be what you're after:
   http://packages.ubuntu.com/search?keywords=libpgsql-ruby

--
   Richard Huxton
   Archonet Ltd

Re: ruby connect

От
Scott Bailey
Дата:
> I’m trying to connect ruby to postgres on ubuntu and the only link I
> found that has the library is down.  Does anyone have the postgres
> library for ruby?  Or direct me to it?

Yeah, I think this is an area that we need to address if we want to see
wider adoption of Postgres. I started out to write a postgres utility in
Ruby. I think I eventually got it to work. But by that time I was
convinced that noone would actually go thru that much hassle in order to
  try out the app. So I wrote it in Python instead. But if I was a Ruby
developer setting out to write a database application, I'm sure I would
have given up on Postgres and used MySQL instead.

Scott