gpt4 book ai didi

ruby-on-rails - Rails 未定义方法 `fetch' 为 "\\# PostgreSQL. Versions 7.4 and 8.x are supported.":String

转载 作者:行者123 更新时间:2023-11-29 14:07:19 26 4
gpt4 key购买 nike

当我在我的生产机器上运行“RAILS_ENV=production bundle exec rake assets:precompile”时,我得到了这个错误:

$ RAILS_ENV=production bundle exec rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/usr/local/rbenv/versions/2.1.0/bin/ruby /usr/local/rbenv/versions/2.1.0/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `fetch' for "\\# PostgreSQL. Versions 7.4 and 8.x are supported.":String
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_specification.rb:35:in `resolve_string_connection'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_specification.rb:25:in `spec'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-3.2.16/lib/active_record/connection_adapters/abstract/connection_specification.rb:130:in `establish_connection'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-3.2.16/lib/active_record/railtie.rb:88:in `block (2 levels) in <class:Railtie>'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-3.2.16/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-3.2.16/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-3.2.16/lib/active_support/lazy_load_hooks.rb:26:in `block in on_load'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-3.2.16/lib/active_support/lazy_load_hooks.rb:25:in `each'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-3.2.16/lib/active_support/lazy_load_hooks.rb:25:in `on_load'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activerecord-3.2.16/lib/active_record/railtie.rb:80:in `block in <class:Railtie>'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-3.2.16/lib/rails/initializable.rb:30:in `instance_exec'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-3.2.16/lib/rails/initializable.rb:30:in `run'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-3.2.16/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-3.2.16/lib/rails/initializable.rb:54:in `each'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-3.2.16/lib/rails/initializable.rb:54:in `run_initializers'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-3.2.16/lib/rails/application.rb:136:in `initialize!'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-3.2.16/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/map7/pais/config/environment.rb:6:in `<top (required)>'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-3.2.16/lib/active_support/dependencies.rb:251:in `require'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-3.2.16/lib/active_support/dependencies.rb:251:in `block in require'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-3.2.16/lib/active_support/dependencies.rb:236:in `load_dependency'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-3.2.16/lib/active_support/dependencies.rb:251:in `require'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-3.2.16/lib/rails/application.rb:103:in `require_environment!'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/railties-3.2.16/lib/rails/application.rb:305:in `block (2 levels) in initialize_tasks'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/usr/local/rbenv/versions/2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-3.2.16/lib/sprockets/assets.rake:93:in `block (2 levels) in <top (required)>'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/usr/local/rbenv/versions/2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:197:in `block in invoke_prerequisites'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:195:in `each'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:195:in `invoke_prerequisites'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
/usr/local/rbenv/versions/2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-3.2.16/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/usr/local/rbenv/versions/2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
/usr/local/rbenv/versions/2.1.0/bin/rake:23:in `load'
/usr/local/rbenv/versions/2.1.0/bin/rake:23:in `<main>'
Tasks: TOP => environment
rake aborted!
Command failed with status (1): [/usr/local/rbenv/versions/2.1.0/bin/ruby /...]
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/file_utils.rb:54:in `block in create_shell_runner'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/file_utils.rb:45:in `call'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/file_utils.rb:45:in `sh'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/file_utils_ext.rb:37:in `sh'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/file_utils.rb:82:in `ruby'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/file_utils_ext.rb:37:in `ruby'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-3.2.16/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-3.2.16/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-3.2.16/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in execute'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/usr/local/rbenv/versions/2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_with_call_chain'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:149:in `invoke_task'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `each'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:106:in `block in top_level'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:115:in `run_with_threads'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:100:in `top_level'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:78:in `block in run'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
/usr/local/rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
/usr/local/rbenv/versions/2.1.0/bin/rake:23:in `load'
/usr/local/rbenv/versions/2.1.0/bin/rake:23:in `<main>'
Tasks: TOP => assets:precompile

我已尝试更新“pg”gem。我可以在我的开发和登台服务器上编译 Assets 。生产机器正在进行最后一次部署(7 天前),我没有更改任何与数据库相关的配置。

最佳答案

“\\# PostgreSQL。支持版本 7.4 和 8.x。” 看起来像 database.yml 文件的损坏的第一行。

\\ 是否意外添加到该行? # 表示普通注释。

关于ruby-on-rails - Rails 未定义方法 `fetch' 为 "\\# PostgreSQL. Versions 7.4 and 8.x are supported.":String,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22003923/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com