无法从Ruby连接到Mysql

时间:2014-10-20 05:23:05

标签: mysql ruby-on-rails ruby cucumber

当我运行黄瓜BDD .feature文件时得到下面提到的错误,但是能够通过Mysql命令行客户端连接。任何解决这个问题的输入都会非常有用,谢谢。

我正在使用:

  • WinXp(64位)
  • Mysql 5.1(64位)
  • Ruby 193
  • 黄瓜0.8.5
  • Mysql 2.8.1
  • watir 1.6.5等。

由于Ruby是32位且Mysql是64位使用 mysql-connector-c-noinstall-6.0.2-win32 来安装带有 mysql的mysql2.8.1 gem - v 2.8.1 --platform = ruby​​ - --with-mysql-dir = C:mysql-connector-c-noinstall-6.0.2-win32 命令。

例外:

@ie
Scenario: Verify that Multiple bookings for the same date is not allowed
Can't connect to MySQL server on 'localhost' (10061) (Mysql::Error)
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/connection_adapters/mysql_adapter.rb:620:in `real_connect'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/connection_adapters/mysql_adapter.rb:620:in `connect'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/connection_adapters/mysql_adapter.rb:203:in `initialize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/connection_adapters/mysql_adapter.rb:75:in `new'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/connection_adapters/mysql_adapter.rb:75:in `mysql_connection'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `block (2 levels) in checkout'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `block in checkout'
C:/Ruby193/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/base.rb:3166:in `quoted_table_name'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/activerecord-2.3.9/lib/active_record/base.rb:902:in `delete_all'
C:/CodeBase/war/behavioural_testing/features/support/env.rb:47:in `Before'

0 个答案:

没有答案