我正在尝试安装“ERPmine”插件:
官方文档: http://www.redmine.org/plugins/wk-time
正如文档所说,并且像我以前用过的每个插件一样:
运行以下命令更新数据库架构:(已中止)
rake redmine:plugins:migrate NAME = redmine_wktime RAILS_ENV = production
已经创建了tbale的错误消息“表'wk_addresses'已经存在”
有些博客通过执行以下内容谈论更新数据库:
rake db:migrate RAILS_ENV=production
但插件设置仍然失败;完整的错误是:
== 5 CreateWkBilling: migrating ===============================================
-- create_table(:wk_addresses)
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: Table 'wk_addresses' already exists: CREATE TABLE `wk_addresses` (`id` int(11) auto_increment PRIMARY KEY, `address1` varchar(255), `address2` varchar(255), `work_phone` varchar(255), `home_phone` varchar(255), `mobile` varchar(255), `email` varchar(255), `fax` varchar(255), `city` varchar(255), `country` varchar(255), `state` varchar(255), `pin` int(11), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in `_query'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in `block in query'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:in `handle_interrupt'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:in `query'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `block in execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
/var/lib/gems/2.1.0/gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/mysql2_adapter.rb:231:in `execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:222:in `create_table'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:474:in `create_table'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:665:in `block in method_missing'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:634:in `block in say_with_time'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:634:in `say_with_time'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:654:in `method_missing'
/opt/redmine/plugins/redmine_wktime/db/migrate/005_create_wk_billing.rb:3:in `change'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:608:in `exec_migration'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:592:in `block (2 levels) in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:591:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:590:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:768:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:1046:in `ddl_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:959:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:955:in `each'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:955:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:823:in `up'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:801:in `migrate'
/opt/redmine/lib/redmine/plugin.rb:481:in `migrate_plugin'
/opt/redmine/lib/redmine/plugin.rb:453:in `migrate'
/opt/redmine/lib/redmine/plugin.rb:464:in `migrate'
/opt/redmine/lib/tasks/redmine.rake:127:in `block (3 levels) in <top (required)>'
/var/lib/gems/2.1.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
ActiveRecord::StatementInvalid: Mysql2::Error: Table 'wk_addresses' already exists: CREATE TABLE `wk_addresses` (`id` int(11) auto_increment PRIMARY KEY, `address1` varchar(255), `address2` varchar(255), `work_phone` varchar(255), `home_phone` varchar(255), `mobile` varchar(255), `email` varchar(255), `fax` varchar(255), `city` varchar(255), `country` varchar(255), `state` varchar(255), `pin` int(11), `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL) ENGINE=InnoDB
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in `_query'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in `block in query'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:in `handle_interrupt'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:in `query'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `block in execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
/var/lib/gems/2.1.0/gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/mysql2_adapter.rb:231:in `execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:222:in `create_table'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:474:in `create_table'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:665:in `block in method_missing'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:634:in `block in say_with_time'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:634:in `say_with_time'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:654:in `method_missing'
/opt/redmine/plugins/redmine_wktime/db/migrate/005_create_wk_billing.rb:3:in `change'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:608:in `exec_migration'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:592:in `block (2 levels) in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:591:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:590:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:768:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:1046:in `ddl_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:959:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:955:in `each'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:955:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:823:in `up'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:801:in `migrate'
/opt/redmine/lib/redmine/plugin.rb:481:in `migrate_plugin'
/opt/redmine/lib/redmine/plugin.rb:453:in `migrate'
/opt/redmine/lib/redmine/plugin.rb:464:in `migrate'
/opt/redmine/lib/tasks/redmine.rake:127:in `block (3 levels) in <top (required)>'
/var/lib/gems/2.1.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
Mysql2::Error: Table 'wk_addresses' already exists
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in `_query'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in `block in query'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:in `handle_interrupt'
/var/lib/gems/2.1.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:in `query'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `block in execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:484:in `block in log'
/var/lib/gems/2.1.0/gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_adapter.rb:478:in `log'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:309:in `execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/mysql2_adapter.rb:231:in `execute'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:222:in `create_table'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:474:in `create_table'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:665:in `block in method_missing'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:634:in `block in say_with_time'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:634:in `say_with_time'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:654:in `method_missing'
/opt/redmine/plugins/redmine_wktime/db/migrate/005_create_wk_billing.rb:3:in `change'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:608:in `exec_migration'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:592:in `block (2 levels) in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:591:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:590:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:768:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:1046:in `ddl_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:959:in `block in migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:955:in `each'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:955:in `migrate'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:823:in `up'
/var/lib/gems/2.1.0/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:801:in `migrate'
/opt/redmine/lib/redmine/plugin.rb:481:in `migrate_plugin'
/opt/redmine/lib/redmine/plugin.rb:453:in `migrate'
/opt/redmine/lib/redmine/plugin.rb:464:in `migrate'
/opt/redmine/lib/tasks/redmine.rake:127:in `block (3 levels) in <top (required)>'
/var/lib/gems/2.1.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => redmine:plugins:migrate
(See full trace by running task with --trace)
有什么建议吗?
答案 0 :(得分:0)
实际上,我发现我应该再次安装之前从sql数据库手动删除ERPmine插件表(因为我以前安装并删除了它)
连接sql后,执行:
Drop Table wk_account_projects;
Drop Table wk_accounts;
Drop Table wk_addresses;
Drop Table wk_contracts;
Drop Table wk_taxes;
Drop Table wk_acc_project_taxes
将删除导致问题的所有表,并使用插件重新安装它们。