ActiveRecord表不存在错误

时间:2014-07-03 17:06:20

标签: ruby-on-rails ruby activerecord jdbc

为什么我找不到表格错误?

?> >> User.connection.execute("select * from users where rownum = 1")
=> //successful result

?> >> User.first
DEPRECATION WARNING: the object returned from `select_all` must respond to `column_types`. (called from first at C:0)
ActiveRecord::JDBCError: Table users does not exist

class User < ActiveRecord::Base
  establish_connection 'db1'
  alias_attribute(:site_type_id, :'SITE_TYPE#ID')
end

1 个答案:

答案 0 :(得分:1)

好的,发现问题...... ActiveRecord不喜欢ojdbc驱动程序jar。一旦我从OJDBC切换到OracleEnhanced适配器就可以了!