未初始化的常量ActiveRecord :: ConnectionAdapters :: PostgreSQLAdapter :: PGconn(NameError)on

时间:2014-01-07 04:35:36

标签: ruby-on-rails postgresql activerecord rspec guard

我在rails 4 app中运行后卫时遇到此错误。起初我认为这是来自rolify gem的问题,因为从用户模型中删除它会暂时删除错误,但它返回了,现在我无法运行套件。

任何想法会导致什么?

uninitialized constant ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::PGconn (NameError)

这是我的gemfile:

source 'https://rubygems.org'
gem 'rails', git: "git@github.com:rails/rails.git", branch: "4-0-stable"
gem "pg"

gem 'sass-rails',   '~> 4.0.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'uglifier'
gem 'foundation-rails'
gem "font-awesome-rails"

gem "soft_service", git: "git@github.com:elskwid/soft_service.git"

gem "attr_encrypted"

gem "awesome_print"

# gem "salesforce_bulk_api", :git => "git@github.com:StepsAway/salesforce_bulk_api.git"
gem "salesforce_bulk"
gem "restforce"
gem "metaforce", path: "~/code/mfpiccolo/metaforce"

# Salesforce Related Gems:
gem 'databasedotcom-oauth2' #basic rest access to salesforce.com.
# alternative gem interface: https://github.com/ejholmes/restforce
# Salesforce / Heroku / et. all seem to have largely abandoned
# databasedotcom as a project, with several features lacking or
# functionallity falling behind EJHolmes restforce gem. It should
# be noted that Eric (EJHolmes) was the original author of
# databasedotcom (i'm like 99.5% sure of that.)

gem 'databasedotcom-rails', :git => 'git@github.com:noeticpenguin/databasedotcom-rails.git'
# this gem gives you some auto-wizbang
# voodoo to automatically back your controllers with models in
# salesforce. Using this gem allows you to autowire, for instance
# the Opportunity controller in your rails app, to salesforces'
# Opportunity object. You may be asking why the git-version?
# my fork (this git version) allows you to use an externally
# gathered oauth token rather than re-logging in on every call. neat.

gem 'omniauth-salesforce' # 'cause if you're going to go to the work
# of setting up an integration with salesforce for data, you might
# as well be able to authenticate against salesforce as well right?

#Nice to have gems:
gem 'activeadmin', github: 'gregbell/active_admin'
# Nice, Quick, stupid simple dsl and framework
# for "admin" sections in your rails app. Use this, for instance,
# to dynamically adjust which properties or fields your
# databasedotcom-rails model's pull / push to optimize speed!

# PDF generation
gem 'wkhtmltopdf-binary'
gem 'wicked_pdf'

#Sys Admin type Gems:
gem 'foreman'
gem 'newrelic_rpm' #Don't be stupid. use newrelic.
gem "hub", ">= 1.10.2", :require => nil, :group => [:development]
gem "figaro", ">= 0.5.3" # Handles creating a github repo for me
gem 'thin', '>= 1.5.0' # http server -- my favorite part of thin
# is that one of their releases was code named "bat shit crazy"

#Authentication, Authorization and Identity Management:
gem "omniauth", ">= 1.1.3"
# gem "omniauth-github"
gem "cancan", ">= 1.6.8"
gem "rolify", ">= 3.2.0"
gem 'devise'

#Testing, Where in a highly opinionated list of Gems is included:
gem 'guard-rspec', group: :development
gem 'rspec-rails', '>= 2.12.2', :group => [:development, :test]
gem 'capybara', '>= 2.0.2', :group => :test
gem "factory_girl_rails", ">= 4.2.0", :group => [:development, :test]
gem "email_spec", ">= 1.4.0", :group => :test

gem "database_cleaner", ">= 0.9.1", :group => :test

gem 'jquery-rails' #Jquery or die.
gem "sendgrid", ">= 1.0.1" #Because email just won't die.
gem "simple_form", ">= 2.0.4" #just ... yeah.

gem "quiet_assets", ">= 1.0.1", :group => :development

gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git'

gem "better_errors", ">= 0.6.0", :group => :development
gem "binding_of_caller", ">= 0.7.1", :group => :development
gem 'pry', :group => [:development, :test], :require => 'pry' # Use pry or else. #srsly.

堆栈追踪:

/Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:839:in `connect': uninitialized constant ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::PGconn (NameError)
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:556:in `initialize'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `new'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `postgresql_connection'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in `checkout_new_connection'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `acquire_connection'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in `block in checkout'
        from /Users/mpiccolo/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
        from /Users/mpiccolo/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/connection_handling.rb:79:in `retrieve_connection'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/connection_handling.rb:53:in `connection'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/querying.rb:36:in `find_by_sql'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/relation.rb:585:in `exec_queries'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/relation.rb:471:in `load'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/relation.rb:220:in `to_a'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/activerecord/lib/active_record/relation/delegation.rb:12:in `each'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/gems/rolify-3.2.0/lib/rolify/dynamic.rb:4:in `load_dynamic_methods'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/gems/rolify-3.2.0/lib/rolify.rb:29:in `rolify'
        from /Users/mpiccolo/code/mfpiccolo/ready-invoice/app/models/user.rb:27:in `<class:User>'
        from /Users/mpiccolo/code/mfpiccolo/ready-invoice/app/models/user.rb:19:in `<top (required)>'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/railties/lib/rails/engine.rb:465:in `block (2 levels) in eager_load!'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/railties/lib/rails/engine.rb:464:in `each'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/railties/lib/rails/engine.rb:464:in `block in eager_load!'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/railties/lib/rails/engine.rb:462:in `each'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/railties/lib/rails/engine.rb:462:in `eager_load!'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/railties/lib/rails/engine.rb:347:in `eager_load!'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/railties/lib/rails/application/finisher.rb:56:in `each'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/railties/lib/rails/application/finisher.rb:56:in `block in <module:Finisher>'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/railties/lib/rails/initializable.rb:30:in `instance_exec'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/railties/lib/rails/initializable.rb:30:in `run'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/railties/lib/rails/initializable.rb:55:in `block in run_initializers'
        from /Users/mpiccolo/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
        from /Users/mpiccolo/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
        from /Users/mpiccolo/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
        from /Users/mpiccolo/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
        from /Users/mpiccolo/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:180:in `each'
        from /Users/mpiccolo/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
        from /Users/mpiccolo/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/railties/lib/rails/initializable.rb:54:in `run_initializers'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/railties/lib/rails/application.rb:215:in `initialize!'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/bundler/gems/rails-5d3a8f1b7e8d/railties/lib/rails/railtie/configurable.rb:30:in `method_missing'
        from /Users/mpiccolo/code/mfpiccolo/ready-invoice/config/environment.rb:5:in `<top (required)>'
        from /Users/mpiccolo/code/mfpiccolo/ready-invoice/spec/spec_helper.rb:3:in `require'
        from /Users/mpiccolo/code/mfpiccolo/ready-invoice/spec/spec_helper.rb:3:in `<top (required)>'
        from /Users/mpiccolo/code/mfpiccolo/ready-invoice/spec/controllers/home_controller_spec.rb:1:in `require'
        from /Users/mpiccolo/code/mfpiccolo/ready-invoice/spec/controllers/home_controller_spec.rb:1:in `<top (required)>'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `load'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `each'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `load_spec_files'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:22:in `run'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:80:in `run'
        from /Users/mpiccolo/.rvm/gems/ruby-2.0.0-p353@ready-invoice/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:17:in `block in autorun'

0 个答案:

没有答案