ruby/sequel/mysql problem

Discussion in 'Ruby' started by Sean Sean, Apr 9, 2009.

  1. Sean Sean

    Sean Sean Guest

    newbie here.

    have ruby/sequel/sqlite and windows 2003 server working smooth.

    but have problem with mysql

    "gem install mysql"

    run a basic ruby test script, got error popop

    "this application has failed to start because LIBMYSQL.dll was not
    found. Re-installing the application may fix the problem."

    Then copy LIBMYSQL.dll from my sql/bin to ruby/bin

    this fixed the problem. Basic ruby / sql connection passed.

    Then try to use sequel model with my sql code as following,

    DB = Sequel.mysql(db_name, db_user, db_password, db_host, db_port)
    class Test < Sequel::Model:)test)
    end
    tt = DB["test"].filter:)key => 'key').first

    got error:

    C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/lib/sequel_core/
    adapters/mysql.rb:149:in `query': Mysql::Error Commands out of sync;
    you can't run this command now (Sequel::DatabaseError)
    from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/
    lib/sequel_core/adapters/mysql.rb:149:in `_execute'
    from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/
    lib/sequel_core/adapters/mysql.rb:108:in `execute'
    from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/
    lib/sequel_core/connection_pool.rb:109:in `hold'
    from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/
    lib/sequel_core/database.rb:440:in `synchronize'
    from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/
    lib/sequel_core/adapters/mysql.rb:108:in `execute'
    from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/
    lib/sequel_core/dataset.rb:477:in `execute'
    from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/
    lib/sequel_core/adapters/mysql.rb:343:in `execute'
    from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/
    lib/sequel_core/adapters/mysql.rb:285:in `fetch_rows'
    from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/
    lib/sequel_core/dataset.rb:462:in `_each'
    from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/
    lib/sequel_core/dataset.rb:213:in `each'
    from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/
    lib/sequel_core/dataset/convenience.rb:181:in `singl
    e_record'
    from C:/dev-tools/ruby/lib/ruby/gems/1.8/gems/sequel-2.11.0/
    lib/sequel_core/dataset/convenience.rb:52:in `first'
    from main.rb:137

    connection looks ok but error on the filter().first same code works
    for sqlite.

    Any idea?

    Appreciate.
    Sean
    --
    Posted via http://www.ruby-forum.com/.
    Sean Sean, Apr 9, 2009
    #1
    1. Advertising

  2. Sean Sean

    Jeremy Evans Guest

    Jeremy Evans, Apr 9, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Randy Lawrence

    mysql-ruby or ruby-mysql?

    Randy Lawrence, May 23, 2004, in forum: Ruby
    Replies:
    3
    Views:
    107
    Randy Lawrence
    May 24, 2004
  2. Sharon Rosner

    Sequel 0.0.9 - Concise ORM for Ruby

    Sharon Rosner, Mar 26, 2007, in forum: Ruby
    Replies:
    0
    Views:
    141
    Sharon Rosner
    Mar 26, 2007
  3. Sharon Rosner
    Replies:
    0
    Views:
    146
    Sharon Rosner
    Apr 16, 2007
  4. Michael Andreasen
    Replies:
    7
    Views:
    167
    John Joyce
    Sep 22, 2007
  5. Ulag Sriramulu

    Merb + Sequel + mysql transactions

    Ulag Sriramulu, Apr 21, 2009, in forum: Ruby
    Replies:
    1
    Views:
    125
    Jeremy Kemper
    Apr 21, 2009
Loading...

Share This Page