我花了一整天的时间试着让rubyrep继续运行,现在我陷入了错误“exception-capted:mysql::error:query:not connected:show tables”中,对此我没有太多的了解。在这一点上,我首先尝试让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
对此有任何想法和建议,我们将不胜感激。
凯特
最佳答案
凯特。
我也面临同样的错误信息,但对于postgres。花点时间找到这本漂亮的指南:
RubyRep Installation by wildcardcorp。
我在那里找到了“rubyforge”的断源链接,这是另一个源链接:http://mirror.as24220.net/pub/rubygems/files/rubyrep/rubyrep-1.2.0.zip
其他的事情对我很好。希望对你有帮助。