-
Notifications
You must be signed in to change notification settings - Fork 504
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
ActiveRecord::StatementInvalid (NoMethodError: undefined method `[]' for nil:NilClass: EXEC sp_executesql N'SELECT @@version'): #413
Comments
@config[:octopus_shard] is null and it causes error, how to fix it? |
I am not totally sure but it may be activerecord-sqlserver-adapter working against sql server 2008 - it is 4.1 branch that seems to be the last one working with that version of sql server |
calh
added a commit
to calh/octopus
that referenced
this issue
Jun 26, 2019
Error message is: ActiveRecord::StatementInvalid: NoMethodError: undefined method `[]' for nil:NilClass: from octopus/lib/octopus/abstract_adapter.rb:23:in `octopus_shard' from octopus/lib/octopus/abstract_adapter.rb:12:in `instrument' from vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log' This has shown to surface in the ibm_db and sqlserver adapters.
calh
added a commit
to calh/octopus
that referenced
this issue
Jun 26, 2019
Error message is: ActiveRecord::StatementInvalid: NoMethodError: undefined method `[]' for nil:NilClass: from octopus/lib/octopus/abstract_adapter.rb:23:in `octopus_shard' from octopus/lib/octopus/abstract_adapter.rb:12:in `instrument' from vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.11.1/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log' This has shown to surface in the ibm_db and sqlserver adapters.
calh
added a commit
to calh/octopus
that referenced
this issue
Jul 18, 2019
Check that @config exists. Fixes thiagopradi#413
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have Rails 4.2 and I have configured shards.yml file in following way:
I cannot connect to database, what I have missed?
The text was updated successfully, but these errors were encountered: