Rails 3.0.3-Oracle_enhanced不起作用 [英] Rails 3.0.3 - Oracle_enhanced doesn't work

查看:41
本文介绍了Rails 3.0.3-Oracle_enhanced不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用带有oracle_enhanced的Ruby 1.8 + Rails 2.3.5,并且运行良好.

I have been using Ruby 1.8 + Rails 2.3.5 with oracle_enhanced and it works fine.

现在,我最近在另一个文件夹上安装了Ruby 1.9.2和Rails 3.0.3,但我无法使其正常工作.

Now I recently installed Ruby 1.9.2 and Rails 3.0.3 on another folder, and I can't get it to work.

当我创建一个简单的应用程序并访问它时,页面返回以下错误:

When I create a simple application and access it, the page returns the following error:

请安装oracle_enhanced 适配器:gem install activerecord-oracle_enhanced-adapter (没有要加载的文件- active_record/connection_adapters/oracle_enhanced_adapter)

Please install the oracle_enhanced adapter: gem install activerecord-oracle_enhanced-adapter (no such file to load -- active_record/connection_adapters/oracle_enhanced_adapter)

我试图调查问题,发现Ruby使用的文件夹为C:\ Ruby192 \ lib \ ruby​​ \ gems \ 1.9.1 \ gems \ activerecord-3.0.3 \ lib \ active_record \ connection_adapters.该文件夹中没有oracle_enhanced_adapter.br文件.

I tried to investigate the problem and found the folder Ruby is using, which is C:\Ruby192\lib\ruby\gems\1.9.1\gems\activerecord-3.0.3\lib\active_record\connection_adapters. In that folder there is no oracle_enhanced_adapter.br file.

该文件位于另一个文件夹C:\ Ruby192 \ lib \ ruby​​ \ gems \ 1.9.1 \ gems \ activerecord-oracle_enhanced-adapter-1.3.1 \ lib \ active_record \ connection_adapters中.我尝试将所有rb文件从该文件夹复制到另一个文件夹,但仍然出现错误,但更改了:

The file is in another folder, C:\Ruby192\lib\ruby\gems\1.9.1\gems\activerecord-oracle_enhanced-adapter-1.3.1\lib\active_record\connection_adapters. I tried to copy all rb files from this folder to the other one, I still got an error but it changed:

请安装oracle_enhanced 适配器:gem install activerecord-oracle_enhanced-adapter (错误:ActiveRecord oracle_enhanced 适配器无法加载ruby-oci8 图书馆.请安装ruby-oci8 宝石.)

Please install the oracle_enhanced adapter: gem install activerecord-oracle_enhanced-adapter (ERROR: ActiveRecord oracle_enhanced adapter could not load ruby-oci8 library. Please install ruby-oci8 gem.)

我注意到我以前的Ruby安装(1.8)具有相同的文件/文件夹结构,并且oracle_enhanced可以工作.

I noticed that my old Ruby install (1.8) has the same file/folder structure, and oracle_enhanced works.

如果我在IRB上手动测试连接可以正常工作,则问题仅在于Rails.

If I test the connection manually on IRB it works fine, the problem is only with Rails.

有人知道吗?

我现在正在使用Webrick,我的宝石列表如下:

I'm using Webrick for now, and my gem list is as follows:

abstract (1.0.0)
actionmailer (3.0.3)
actionpack (3.0.3)
activemodel (3.0.3)
activerecord (3.0.3)
activerecord-oracle_enhanced-adapter (1.3.1)
activeresource (3.0.3)
activesupport (3.0.3)
arel (2.0.6)
builder (2.1.2)
bundler (1.0.7)
cgi_multipart_eof_fix (2.5.0)
erubis (2.6.6)
gem_plugin (0.2.3)
hoe (2.8.0)
i18n (0.5.0)
mail (2.2.13)
mime-types (1.16)
minitest (1.6.0)
mongrel (1.1.5 x86-mingw32)
oracle_enhanced (1.2.5)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.6)
rails (3.0.3)
railties (3.0.3)
rake (0.8.7)
rdoc (2.5.8)
ruby-oci8 (2.0.4 x86-mingw32)
sqlite3-ruby (1.3.2 x86-mingw32)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.23)

谢谢.

推荐答案

在Rails 3中,您必须在Gemfile中指定所有gem依赖项.请参阅带有ruby-oci8和oracle_enhanced适配器的Gemfile示例: https://github.com/rsim /rails3_oracle_sample/blob/master/Gemfile

In Rails 3 you have to specify all your gem dependencies in Gemfile. See example of Gemfile with ruby-oci8 and oracle_enhanced adapter: https://github.com/rsim/rails3_oracle_sample/blob/master/Gemfile

在Gemfile中指定了gem依赖关系后,您需要运行bundle install以确保已安装所有必需的gem.之后,您应该可以使用oracle_enhanced适配器.

After specifying your gem dependencies in Gemfile you need to run bundle install to ensure that all necessary gems are installed. After that you should be able to use oracle_enhanced adapter.

这篇关于Rails 3.0.3-Oracle_enhanced不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆