Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails ActiveRecord表不存在错误_Ruby On Rails_Ruby_Activerecord_Jdbc - Fatal编程技术网

Ruby on rails ActiveRecord表不存在错误

Ruby on rails ActiveRecord表不存在错误,ruby-on-rails,ruby,activerecord,jdbc,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

为什么我得到一个表未找到错误

?> >> 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

好的,找到问题了。。。ActiveRecord不喜欢ojdbc驱动程序jar。我一从OJDBC切换到OracleEnhanced适配器,它就工作了

为什么不先执行User.whererownum=1.first?@Vimsha无所谓?>>>User.where'rownum=1'弃用警告:从select_all`返回的对象必须响应列类型。从IRB调用C:/jruby-1.7.10/lib/ruby/1.9/IRB/inspector.rb:86 ActiveRecord::jdbError:Table users不存在`users表的迁移看起来像什么?@user3334690向问题添加了信息users表上的主键是什么?