Rails and PostgreSQL

C

Colin Freas

------=_Part_7570_10649609.1133995488272
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

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"=3D>"new", "controller"=3D>"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/mes=
sage.rb:41:in
`read'
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/con=
nection.rb:30:in
`initialize'
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/con=
nection.rb:29:in
`loop'
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/con=
nection.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=3D'
/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_controlle=
r/scaffolding.rb:116:in
`new'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controlle=
r/scaffolding.rb:116:in
`new'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controlle=
r/base.rb:756:in
`send'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controlle=
r/base.rb:756:in
`perform_action_without_filters'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controlle=
r/filters.rb:295:in
`perform_action_without_benchmark'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controlle=
r/benchmarking.rb:41:in
`perform_action_without_rescue'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controlle=
r/benchmarking.rb:41:in
`measure'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controlle=
r/benchmarking.rb:41:in
`perform_action_without_rescue'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controlle=
r/rescue.rb:80:in
`perform_action'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controlle=
r/base.rb:356:in
`send'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controlle=
r/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:10=
5: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 ha=
d
been fixed.

Any help appreciated.

Thanks,
Colin Freas

------=_Part_7570_10649609.1133995488272--
 
C

Colin Freas

------=_Part_12878_30618767.1134020615429
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Roger that, Joe.

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



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

------=_Part_12878_30618767.1134020615429--
 
J

Jeremy Kemper

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top