Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem on Rails5 with 0.10.0 #12

Open
MasahiroMorita opened this issue Jun 20, 2018 · 1 comment
Open

Problem on Rails5 with 0.10.0 #12

MasahiroMorita opened this issue Jun 20, 2018 · 1 comment

Comments

@MasahiroMorita
Copy link

MasahiroMorita commented Jun 20, 2018

Rails versions:

  • rails: 5.0.7
  • rspec: 3.7
  • ruby: 2.3.0
  • postamt: 0.10.0

When I ran rspec for some models, it caused the following error.
Does anybody know postamt 0.10.0 can support Rails 5.0?

 Failure/Error: Postamt.force_connection || Postamt.connection_stack.last || Postamt.overwritten_default_connections[klass.name] || klass.default_connection || Postamt.default_connection
       
       NoMethodError:
         undefined method `name' for "primary":String
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/postamt-d4ac81440aab/lib/postamt/connection_handler.rb:96:in `connection_for'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/postamt-d4ac81440aab/lib/postamt/connection_handler.rb:104:in `pool_for'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/postamt-d4ac81440aab/lib/postamt/connection_handler.rb:73:in `retrieve_connection_pool'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/postamt-d4ac81440aab/lib/postamt/connection_handler.rb:51:in `retrieve_connection'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.7/lib/active_record/connection_handling.rb:128:in `retrieve_connection'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.7/lib/active_record/connection_handling.rb:91:in `connection'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.7/lib/active_record/fixtures.rb:516:in `create_fixtures'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.7/lib/active_record/fixtures.rb:1015:in `load_fixtures'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.7/lib/active_record/fixtures.rb:988:in `setup_fixtures'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activerecord-5.0.7/lib/active_record/fixtures.rb:852:in `before_setup'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-rails-3.7.2/lib/rspec/rails/adapters.rb:126:in `block (2 levels) in <module:MinitestLifecycleAdapter>'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:447:in `instance_exec'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:447:in `instance_exec'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:375:in `execute_with'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:608:in `block (2 levels) in run_around_example_hooks_for'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:342:in `call'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:609:in `run_around_example_hooks_for'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:466:in `run'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:457:in `with_around_example_hooks'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:500:in `with_around_and_singleton_context_hooks'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/example.rb:251:in `run'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/example_group.rb:628:in `block in run_examples'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/example_group.rb:624:in `map'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/example_group.rb:624:in `run_examples'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/example_group.rb:590:in `run'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:118:in `block (3 levels) in run_specs'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:118:in `map'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:118:in `block (2 levels) in run_specs'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/configuration.rb:1926:in `with_suite_hooks'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:113:in `block in run_specs'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:79:in `report'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:112:in `run_specs'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:87:in `run'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:71:in `run'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:45:in `invoke'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rspec-core-3.7.1/exe/rspec:4:in `<top (required)>'
       # /usr/local/rbenv/versions/2.3.0/bin/rspec:23:in `load'
       # /usr/local/rbenv/versions/2.3.0/bin/rspec:23:in `<top (required)>'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0/bundler/cli/exec.rb:74:in `load'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0/bundler/cli/exec.rb:74:in `kernel_load'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0/bundler/cli/exec.rb:28:in `run'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0/bundler/cli.rb:424:in `exec'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0/bundler/cli.rb:27:in `dispatch'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0/bundler/cli.rb:18:in `start'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.16.2/exe/bundle:30:in `block in <top (required)>'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/site_ruby/2.3.0/bundler/friendly_errors.rb:124:in `with_friendly_errors'
       # /usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.16.2/exe/bundle:22:in `<top (required)>'
       # /usr/local/rbenv/versions/2.3.0/bin/bundle:23:in `load'
       # /usr/local/rbenv/versions/2.3.0/bin/bundle:23:in `<main>'
       # 
       #   Showing full backtrace because every line was filtered out.
       #   See docs for RSpec::Configuration#backtrace_exclusion_patterns and
       #   RSpec::Configuration#backtrace_inclusion_patterns for more information.

I installed postamt 0.10.0 by like:

gem 'postamt', github: 'sauspiel/postamt', branch: 'rails5'
@aitizazk
Copy link

Were you able to figure out something? running into the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants