Forum: Ruby Rails and PostgreSQL

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1e40cf754e04f23c034b63d0c2e2127b?d=identicon&s=25 colinfreas (Guest)
on 2005-12-07 23:45
(Received via mailing list)
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
A70a5e80f81077fb5181b6104fffa891?d=identicon&s=25 batkins57 (Guest)
on 2005-12-07 23:53
(Received via mailing list)
What output do you get when you run "free" in a shell?
38a8230ed3d5c685558b4f0aad3fc74b?d=identicon&s=25 joevandyk (Guest)
on 2005-12-07 23:53
(Received via mailing list)
On 12/7/05, Colin Freas <colinfreas@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
1e40cf754e04f23c034b63d0c2e2127b?d=identicon&s=25 colinfreas (Guest)
on 2005-12-08 06:47
(Received via mailing list)
Roger that, Joe.

Looks like my problem goes away using PostgreSQL 8, though, for anyone
here
who might run into the same problem.
24d2f8804e6bb4b7ea6bd11e0a586470?d=identicon&s=25 jeremy (Guest)
on 2005-12-08 06:59
(Received via mailing list)
-----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-----
B84d42a3a5c343f8fc6ab7d7f47fd3f5?d=identicon&s=25 robby.lists (Guest)
on 2005-12-08 16:00
(Received via mailing list)
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
*******************************************************/
This topic is locked and can not be replied to.