开发者

undefined method has_key? for false:FalseClass (NoMethodError)

I am trying to use Octopus gem for database sharding. I followed this wiki.

If you need dynamic shards using shards configuration saved in database, you can create a initializer containing something as this example:

begin
  shards = {:my_shards => {}}
  Shard.all.each do |shard|
    shards[:my_shards][shard.database] = {:host => shard.host, :adapter => shard.adapter, :database => shard.database, :username => shard.username, :password => shard.password, :encoding => shard.encoding }
  end

 Octopus.setup do |config|
    config.shards = shards
    config.environments = [:development, :testing, :production, :staging]
  end

rescue ActiveRecord::StatementInvalid => e
  puts e
end

And i am getting this error when i try to start application. I am using rails 3.0.9

C:/Ruby192/lib/ruby/gems/1.9.1/gems/ar-octopus-0.3.4/lib/octopus/proxy.rb:16:in `initialize_shards': undefined method开发者_C百科 `has_key?' f or false:FalseClass (NoMethodError)

Any help will be appreciated.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜