jruby和oracle_enhaced适配器的连接字符串无效
我已经按照如下方式配置了rails应用程序的数据库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/
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