Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rails and PostgreSQL

0 views
Skip to first unread message

Colin Freas

unread,
Dec 7, 2005, 5:44:55 PM12/7/05
to
I'm trying to get Rails up and running using a PostgreSQL database, and
unfortunately I'm doing this on a machine I don't administer directly.

I can get Rails responding using the WEBrick server, and 'hello, world'
pages work fine.

However, after creating a database (on a seperate server) I can't seem to
get Rails speaking to it. At first, the Postgres gem wasn't installed, but
I had the sysadmin put that in. Now, though, I'm getting this error:

Processing CraftController#new (for 141.161.18.159 at Wed Dec 07 14:32:38
PST 2005)
Parameters: {"action"=>"new", "controller"=>"craft"}


NoMemoryError (failed to allocate memory):
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/buffer.rb:64:in
`read'
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/buffer.rb:64:in
`copy_from_stream'
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/message.rb:41:in
`read'
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/connection.rb:30:in
`initialize'
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/connection.rb:29:in
`loop'
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/connection.rb:29:in
`initialize'
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0
/lib/postgres-pr/postgres-compat.rb:23:in `new'
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0
/lib/postgres-pr/postgres-compat.rb:23:in `initialize'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in
`connect'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in
`postgresql_connection'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/query_cache.rb:52:in
`send'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/query_cache.rb:52:in
`connection='
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/abstract_adapter.rb:108:in
`retrieve_connection'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:239:in
`connection'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:246:in
`connection'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:1322:in
`attributes_from_column_definition'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:928:in
`initialize_without_callbacks'
/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/callbacks.rb:236:in
`initialize'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/scaffolding.rb:116:in
`new'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/scaffolding.rb:116:in
`new'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in
`send'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in
`perform_action_without_filters'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in
`perform_action_without_benchmark'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in
`perform_action_without_rescue'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in
`measure'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in
`perform_action_without_rescue'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in
`perform_action'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in
`send'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in
`process'
/usr/local/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in
`dispatch'
/usr/local/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:105:in
`handle_dispatch'
/usr/local/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:71:in
`service'
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/local/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'
/usr/local/lib/ruby/1.8/webrick/server.rb:144:in `start'
/usr/local/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'
/usr/local/lib/ruby/1.8/webrick/server.rb:94:in `start'
/usr/local/lib/ruby/1.8/webrick/server.rb:89:in `each'
/usr/local/lib/ruby/1.8/webrick/server.rb:89:in `start'
/usr/local/lib/ruby/1.8/webrick/server.rb:79:in `start'
/usr/local/lib/ruby/1.8/webrick/server.rb:79:in `start'
/usr/local/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:57:in
`dispatch'
script/server:49


So, it looks like it's something with memory, but... I can't figure out
what. Has anyone else run into this? I'm running against a 7.3 database,
though, I'd heard Rails likes 8 and later, although, I'd also heard that had
been fixed.

Any help appreciated.

Thanks,
Colin Freas

Bill Atkins

unread,
Dec 7, 2005, 5:49:20 PM12/7/05
to
What output do you get when you run "free" in a shell?


--
Bill Atkins


Joe Van Dyk

unread,
Dec 7, 2005, 5:50:43 PM12/7/05
to
On 12/7/05, Colin Freas <colin...@gmail.com> wrote:
> I'm trying to get Rails up and running using a PostgreSQL database, and
> unfortunately I'm doing this on a machine I don't administer directly.

Rails-specific questions should go on the Rails mailing list.
http://lists.rubyonrails.org/mailman/listinfo/rails


Colin Freas

unread,
Dec 8, 2005, 12:43:41 AM12/8/05
to
Roger that, Joe.

Looks like my problem goes away using PostgreSQL 8, though, for anyone here
who might run into the same problem.

Jeremy Kemper

unread,
Dec 8, 2005, 12:59:32 AM12/8/05
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Dec 7, 2005, at 9:43 PM, Colin Freas wrote:
> Looks like my problem goes away using PostgreSQL 8, though, for
> anyone here
> who might run into the same problem.

I've had better results with the C bindings as well:
gem install postgres

Best,
jeremy

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFDl8u7AQHALep9HFYRAjR+AJ9KunBM98iEDSaF/fQjQmxDvYfiqACfcOOe
Ybdx0yy9c29ImiK4xXMYO3s=
=uy07
-----END PGP SIGNATURE-----


Robby Russell

unread,
Dec 8, 2005, 9:58:06 AM12/8/05
to
On Thu, 2005-12-08 at 14:59 +0900, Jeremy Kemper wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Dec 7, 2005, at 9:43 PM, Colin Freas wrote:
> > Looks like my problem goes away using PostgreSQL 8, though, for
> > anyone here
> > who might run into the same problem.
>
> I've had better results with the C bindings as well:
> gem install postgres

Same here!

Robby

--
/******************************************************
* Robby Russell, Founder.Developer.Geek
* PLANET ARGON, Rails Development, Consulting & Hosting
* Portland, Oregon | p: 503.351.4730 | f: 815.642.4068
* www.planetargon.com | www.robbyonrails.com
* Programming Rails | www.programmingrails.com
*******************************************************/

0 new messages