zoukankan      html  css  js  c++  java
  • 请高手指教

    我在测试rails时,出现的错误:弄了,半天,不知道那地方错误,请高手指点
    1) Error:
    test_truth(MemberTest):
    ActiveRecord::StatementInvalid: Mysql::Error: #23000Duplicate entry '' for key 2
    : INSERT INTO members (`id`) VALUES (1)
        c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connect
    ion_adapters/abstract_adapter.rb:128:in `log'
        c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connect
    ion_adapters/mysql_adapter.rb:243:in `execute'
        c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/fixture
    s.rb:290:in `insert_fixtures'
        c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/fixture
    s.rb:289:in `each'
        c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/fixture
    s.rb:289:in `insert_fixtures'
        c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/fixture
    s.rb:257:in `create_fixtures'
        c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/fixture
    s.rb:257:in `each'
        c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/fixture
    s.rb:257:in `create_fixtures'
        c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/connect
    ion_adapters/abstract/database_statements.rb:59:in `transaction'
        c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/fixture
    s.rb:255:in `create_fixtures'
        c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/base.rb
    :867:in `silence'
        c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/fixture
    s.rb:248:in `create_fixtures'
        c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/fixture
    s.rb:593:in `load_fixtures'
        c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/fixture
    s.rb:538:in `setup'

    1 tests, 0 assertions, 0 failures, 1 errors

  • 相关阅读:
    Android——Room数据库版本管理(保留现有数据不丢失)
    javaweb分页查询实现
    《人月神话》读后感(一)
    Android Studio代理-build过慢以及gradle下载失败解决方案
    Room----Android数据库(SQLite)
    Android Jetpack -- Lifecycles篇
    Android学习进度四
    Android Jetpack -- Navigation 篇
    Android Jetpack -- ViewModel篇(二)
    Android Jetpack -- ViewModel篇(一)
  • 原文地址:https://www.cnblogs.com/Angle/p/985427.html
Copyright © 2011-2022 走看看