RubyRep设置导致错误"捕获异常:Mysql ::错误:查询:未连接:SHOW TABLES"

时间:2014-07-14 14:54:58

标签: ruby linux gem

我花了一整天的时间试图让RubyRep继续运行,现在我仍然坚持错误“异常捕获:Mysql ::错误:查询:未连接:显示表”我找不到多少洞察力。在这一点上,我首先尝试让RubyRep在两个本地数据库上运行(以消除潜在的权限问题),但仍然没有运气。我目前的RubyRep配置是:

RR::Initializer::run do |config|
  config.left = {
    :adapter  => 'mysql',
    :database => 'main_logger',
    :username => 'root',
    :password => 'password',
    :host     => 'localhost'
  }

  config.right = {
    :adapter  => 'mysql',
    :database => 'test',
    :username => 'root',
    :password => 'password',
    :host     => 'localhost'
  }

  config.include_tables 'app_logs'
  # config.include_tables /^e/ # regexp matching all tables starting with e
  # config.include_tables /./ # regexp matching all tables in the database
end

使用此配置,如果我运行# rubyrep scan -c rubyrep.conf,我会得到:

DEPRECATION WARNING: In the next release, this will return the same as connection_pool_list. (An array of pools, rather than a hash mapping specs to pools.). (called from connection_pools at /usr/local/rvm/gems/ruby-2.1.2/gems/activerecord-4.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:500)
DEPRECATION WARNING: In the next release, this will return the same as #connection_pool_list. (An array of pools, rather than a hash mapping specs to pools.). (called from connection_pools at /usr/local/rvm/gems/ruby-2.1.2/gems/activerecord-4.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:500)
Exception caught: Mysql::Error: query: not connected: SHOW TABLES

对此有任何想法和建议非常感谢。

凯特

1 个答案:

答案 0 :(得分:1)

凯特。

我遇到了相同的错误消息,但对于Postgres。花一些时间,发现这个漂亮的指南: RubyRep Installation by wildcardcorp

我在那里找到了“rubyforge”的源代码链接,这是另一种来源链接:http://mirror.as24220.net/pub/rubygems/files/rubyrep/rubyrep-1.2.0.zip

其他事情对我来说很好。希望它会对你有所帮助。