zam*_*zam 20 ruby ruby-on-rails redmine
我正在尝试将我的redmine从1.3.0升级到2.0.0,但是我在数据库迁移方面遇到了问题.当我运行命令时:
rake db:migrate RAILS_ENV=production
Run Code Online (Sandbox Code Playgroud)
它显示了一个错误
rake aborted!
uninitialized constant RAILS_ENV
Run Code Online (Sandbox Code Playgroud)
我的错误日志是:
ActiveRecord::SubclassNotFound (The single-table inheritance mechanism failed to locate the subclass: 'GoogleAppsAuthSource'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite AuthSource.inheritance_column to use another column for that information.):
app/models/user.rb:139:in `try_to_login'
app/controllers/account_controller.rb:143:in `password_authentication'
app/controllers/account_controller.rb:138:in `authenticate_user'
app/controllers/account_controller.rb:30:in `login'
Run Code Online (Sandbox Code Playgroud)
这是我在旧redmine中使用的插件列表:
Google Apps插件
Redmine Code Review插件
Redmine Hudson插件
请帮我
cbr*_*ron 69
如果其他人偶然发现有两种方法可以解决问题
手动将列名设置为无意义的内容:
self.inheritance_column = :_type_disabled
Run Code Online (Sandbox Code Playgroud)
请参阅:http://apidock.com/rails/ActiveRecord/Base/inheritance_column/class
Tig*_*ine 18
单表继承错误可能是由type数据库中命名的列引起的.
如果rails遇到名为的列名,type则假定它是一个具有Subclasses的Model,因此该类型可以区分要使用的模型.我想一些最初不是为rails构建的插件type在它的模型中使用了一个列,导致Rails失败.
| 归档时间: |
|
| 查看次数: |
13102 次 |
| 最近记录: |