NoMethodError: undefined method `fformat' - rake aborted!


#1

Hello,

I have installed postgresql 8.3 in linux Mint 6 r1 (ubuntu 8.10) and the
ruby from ubuntu repositories, then “gem install rails -y”

I’ve installed “gem -install postgres-pr -y” and configured the
database.yml as follows:

database.yml
#########################################
common: &common
adapter: postgresql
timeout: 5000
host: localhost
username: eric
password: ************
enconding: utf8

development:
database: panthro_devel
<<: *common

test:
database: panthro_test
<<: *common

production:
database: panthro
<<: *common

#########################################

Those databases are created in the server, and the auth in my
pg_hba.conf for local connections is setted on “trust” value.

I’ve issued some scaffolding for 2 entities, and tried to migrate them
with “rake db:migrate --trace” and i’ve got the following error trace:

error trace:
#########################################
(in /home/eric/Proyectos/panthro)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
NoMethodError: undefined method fformat' for #<PGresult:0xb7afce74>: SHOW client_min_messages /home/eric/Proyectos/panthro/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:147:inlog’
/home/eric/Proyectos/panthro/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:444:in
query' /home/eric/Proyectos/panthro/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:605:inclient_min_messages’
/home/eric/Proyectos/panthro/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:245:in
supports_standard_conforming_strings?' /home/eric/Proyectos/panthro/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:836:inconnect’
/home/eric/Proyectos/panthro/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:185:in
initialize' /home/eric/Proyectos/panthro/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:37:innew’
/home/eric/Proyectos/panthro/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in
postgresql_connection' /home/eric/Proyectos/panthro/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:insend’
/home/eric/Proyectos/panthro/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:in
connection=' /home/eric/Proyectos/panthro/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:260:inretrieve_connection’
/home/eric/Proyectos/panthro/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
connection' /home/eric/Proyectos/panthro/vendor/rails/activerecord/lib/active_record/migration.rb:386:ininitialize’
/home/eric/Proyectos/panthro/vendor/rails/activerecord/lib/active_record/migration.rb:357:in
new' /home/eric/Proyectos/panthro/vendor/rails/activerecord/lib/active_record/migration.rb:357:inup’
/home/eric/Proyectos/panthro/vendor/rails/activerecord/lib/active_record/migration.rb:340:in
migrate' /home/eric/Proyectos/panthro/vendor/rails/railties/lib/tasks/databases.rake:99 /usr/lib/ruby/1.8/rake.rb:546:incall’
/usr/lib/ruby/1.8/rake.rb:546:in execute' /usr/lib/ruby/1.8/rake.rb:541:ineach’
/usr/lib/ruby/1.8/rake.rb:541:in execute' /usr/lib/ruby/1.8/rake.rb:508:ininvoke_with_call_chain’
/usr/lib/ruby/1.8/rake.rb:501:in synchronize' /usr/lib/ruby/1.8/rake.rb:501:ininvoke_with_call_chain’
/usr/lib/ruby/1.8/rake.rb:494:in invoke' /usr/lib/ruby/1.8/rake.rb:1931:ininvoke_task’
/usr/lib/ruby/1.8/rake.rb:1909:in top_level' /usr/lib/ruby/1.8/rake.rb:1909:ineach’
/usr/lib/ruby/1.8/rake.rb:1909:in top_level' /usr/lib/ruby/1.8/rake.rb:1948:instandard_exception_handling’
/usr/lib/ruby/1.8/rake.rb:1903:in top_level' /usr/lib/ruby/1.8/rake.rb:1881:inrun’
/usr/lib/ruby/1.8/rake.rb:1948:in standard_exception_handling' /usr/lib/ruby/1.8/rake.rb:1878:inrun’
/usr/bin/rake:28
#####################################

I’ve looked into “abstract_adapter.rb” and “postgresql_adapter.rb” in
those lines just for curiosity to see the problem with a better aproach,
but I’ve got nothing since I’m not just mastering rails…

It would be great if some of you could helpme with this issue. I beg you
sorry about my english! XD

Thank you in advance!


#2

Sorry, I’ve forgotten to say that I’ve tried to issue manually those
queries that postgresql_adapter.rb does, and jere are the results, just
in case that could help:

postgresql_adapter.rb (line 251):

  query('SHOW standard_conforming_strings')[0][0] => 'off'

postgresql_adapter.rb (line 605):

  query('SHOW client_min_messages')[0][0] => 'notice'

#3

Did you solve this error ??
but I’m using postgres psql (8.4.1)

NoMethodError in UsuariosController#index

undefined method `fformat’ for #PGresult:0x7f7f37b4daa8

vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:472:in
result_as_array' vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:470:ineach’
vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:470:in
result_as_array' vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:1001:inselect_raw’
vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:987:in
select' vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:7:inselect_all_without_query_cache’
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in
select_all' vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:81:incache_sql’
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in
select_all' vendor/rails/activerecord/lib/active_record/base.rb:635:infind_by_sql’
vendor/rails/activerecord/lib/active_record/base.rb:1490:in find_every' vendor/rails/activerecord/lib/active_record/base.rb:589:infind’
app/controllers/usuarios_controller.rb:5:in index' vendor/rails/actionpack/lib/action_controller/base.rb:1256:insend’
vendor/rails/actionpack/lib/action_controller/base.rb:1256:in
perform_action_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:617:incall_filters’
vendor/rails/actionpack/lib/action_controller/filters.rb:610:in
perform_action_without_benchmark' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:inperform_action_without_rescue’
vendor/rails/actionpack/lib/action_controller/rescue.rb:136:in
perform_action_without_caching' vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:13:inperform_action’
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in
cache' vendor/rails/activerecord/lib/active_record/query_cache.rb:8:incache’
vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:12:in
perform_action' vendor/rails/actionpack/lib/action_controller/base.rb:524:insend’
vendor/rails/actionpack/lib/action_controller/base.rb:524:in
process_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:606:inprocess_without_session_management_support’
vendor/rails/actionpack/lib/action_controller/session_management.rb:134:in
process' vendor/rails/actionpack/lib/action_controller/base.rb:392:inprocess’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:184:in
handle_request' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:112:indispatch_unlocked’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:125:in
dispatch' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:124:insynchronize’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:124:in
dispatch' vendor/rails/actionpack/lib/action_controller/dispatcher.rb:134:indispatch_cgi’
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:41:in
dispatch' vendor/rails/railties/lib/webrick_server.rb:103:inhandle_dispatch’
vendor/rails/railties/lib/webrick_server.rb:74:in service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:inservice’
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/lib/ruby/1.8/webrick/server.rb:173:instart_thread’
/usr/lib/ruby/1.8/webrick/server.rb:162:in start' /usr/lib/ruby/1.8/webrick/server.rb:162:instart_thread’
/usr/lib/ruby/1.8/webrick/server.rb:95:in start' /usr/lib/ruby/1.8/webrick/server.rb:92:ineach’
/usr/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/lib/ruby/1.8/webrick/server.rb:23:instart’
/usr/lib/ruby/1.8/webrick/server.rb:82:in start' vendor/rails/railties/lib/webrick_server.rb:60:indispatch’
vendor/rails/railties/lib/commands/servers/webrick.rb:66
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:inrequire’
vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in
require' vendor/rails/activesupport/lib/active_support/dependencies.rb:521:innew_constants_in’
vendor/rails/activesupport/lib/active_support/dependencies.rb:153:in
require' vendor/rails/railties/lib/commands/server.rb:49 /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require’
script/server:3

PLEASE HELPPP !!!


#4

Eric Roscher wrote:

Hello,

I have installed postgresql 8.3 in linux Mint 6 r1 (ubuntu 8.10) and the
ruby from ubuntu repositories, then “gem install rails -y”

I’ve installed “gem -install postgres-pr -y”
[…]

Is there any particular reason that you’re using postgres-pr instead of
postgres or pg?

Best,

Marnen Laibow-Koser
http://www.marnen.org
removed_email_address@domain.invalid