Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/10.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
jruby和oracle_enhaced适配器的连接字符串无效_Oracle_Jruby - Fatal编程技术网

jruby和oracle_enhaced适配器的连接字符串无效

jruby和oracle_enhaced适配器的连接字符串无效,oracle,jruby,Oracle,Jruby,我已经按照如下方式配置了rails应用程序的数据库 test: adapter: oracle_enhanced host: localhost database: localhost:1521/xe username: test password: test pool: 50 wait_timeout: 10 tns: xe 它使用REE和oracled_增强适配器工作,但不与jruby一起工作,而是出现以下错误: % rake spec (in /home/

我已经按照如下方式配置了rails应用程序的数据库

test:
  adapter: oracle_enhanced
  host: localhost
  database: localhost:1521/xe
  username: test
  password: test
  pool: 50
  wait_timeout: 10
  tns: xe
它使用REE和oracled_增强适配器工作,但不与jruby一起工作,而是出现以下错误:

% rake spec
(in /home/xxxxxxxx)
rake aborted!
java.sql.SQLException: Io exception: Invalid connection string format, a valid format is: "host:port:sid"

我还不能让它打印它试图使用的实际连接字符串。使用
--trace
运行rake也没有帮助。有什么办法让它工作吗?

试试这个连接字符串:

test:
  adapter: oracle_enhanced
  driver: oracle.jdbc.pool.OracleDataSource
  url: jdbc:oracle:thin:@localhost:1521:xe
  ...
这种格式适合我
/Mads

在我的案例中,通过确保将
ORACLE\u HOME
TNS\u ADMIN
环境变量设置为即时客户端安装目录,解决了此问题:

$ echo $ORACLE_HOME
/Library/Oracle/instantclient/11.2.0.3.0
$ echo $TNS_ADMIN
/Library/Oracle/instantclient/11.2.0.3.0