ruby-oci8 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,38 @@
1
+ What is ruby-oci8
2
+ =================
3
+
4
+ Ruby-oci8 is a ruby interface for Oracle Database. The latest version
5
+ is available for all Oracle versions after Oracle 9i including Oracle
6
+ Instant Client.
7
+
8
+ If you need to use Oracle 8, use ruby-oci8 2.0.6.
9
+
10
+ As for Oracle7, use Oracle7 Module for Ruby by Yoshida Masato.
11
+
12
+ What's new
13
+ ==========
14
+
15
+ See {file:NEWS}.
16
+
17
+ Sample one-liner
18
+ ================
19
+
20
+ Connect to scott/tiger, select `emp` and print as CSV format.
21
+
22
+ ruby -r oci8 -e "OCI8.new('scott', 'tiger').exec('select * from emp') do |r| puts r.join(','); end"
23
+
24
+ If you install a ruby-oci8 gem package, you may need to add `-rubygems` before `-r oci8`.
25
+
26
+ Installation
27
+ ============
28
+
29
+ * {file:docs/install-full-client.md}
30
+ * {file:docs/install-instant-client.md}
31
+ * {file:docs/install-binary-package.md}
32
+
33
+ Report issues
34
+ =============
35
+
36
+ * {file:docs/report-installation-issue.md}
37
+ * [The issues page on github](https://github.com/kubo/ruby-oci8/issues)
38
+ * [The ruby-oci8 help forum on rubyforge](http://rubyforge.org/forum/forum.php?forum_id=1078)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.0
1
+ 2.1.1
data/dist-files CHANGED
@@ -1,18 +1,19 @@
1
+ .yardopts
1
2
  ChangeLog
2
3
  Makefile
3
4
  NEWS
4
- README
5
+ README.md
5
6
  VERSION
6
7
  dist-files
7
8
  metaconfig
8
9
  pre-distclean.rb
9
10
  ruby-oci8.gemspec
10
11
  setup.rb
11
- doc/api.en.html
12
- doc/api.en.rd
13
- doc/api.ja.html
14
- doc/api.ja.rd
15
- doc/manual.css
12
+ docs/install-binary-package.md
13
+ docs/install-full-client.md
14
+ docs/install-instant-client.md
15
+ docs/platform-specific-issues.md
16
+ docs/report-installation-issue.md
16
17
  ext/oci8/.document
17
18
  ext/oci8/MANIFEST
18
19
  ext/oci8/apiwrap.c.tmpl
@@ -0,0 +1,40 @@
1
+ # @title Install Binary Package
2
+
3
+ Windows 32-bit (mingw32 ruby)
4
+ =============================
5
+
6
+ Run the following command:
7
+
8
+ gem install ruby-oci8
9
+
10
+ Windows 32-bit (mswin32 ruby)
11
+ =============================
12
+
13
+ Run the following command:
14
+
15
+ gem install --platform x86-mingw32 ruby-oci8
16
+
17
+ Ruby-oci8 gem for x86-mingw32 works on mswin32 ruby.
18
+ If it doesn't work, see {file:docs/install-instant-client.md} or {file:docs/install-full-client.md}.
19
+
20
+ Other platforms
21
+ ===============
22
+
23
+ We doesn't make binary gems for other platforms.
24
+ If you need to distribute a binary gem, compile ruby-oci8 and run the following command.
25
+
26
+ gem build ruby-oci8.gemspec -- current
27
+
28
+ Note that you need to compile it on the oldest versions of the platform you support
29
+ and for the oldest versions of the Oracle databases.
30
+
31
+ If you could not fix the Oracle versions, compile ruby-oci8 and make a gem as follows:
32
+
33
+ gzip -dc ruby-oci8-VERSION.tar.gz | tar xvf -
34
+ cd ruby-oci8-VERSION
35
+ ruby setup.rb config -- --with-runtime-check
36
+ make
37
+ gem build ruby-oci8.gemspec -- current
38
+
39
+ When the option `--with-runtime-check` is set, ruby-oci8 checks the Oracle version
40
+ and available OCI functions at runtime.
@@ -0,0 +1,116 @@
1
+ # @title Install for Oracle Full Client
2
+
3
+ Introduction
4
+ ============
5
+
6
+ This page explains the way to install ruby-oci8 for Oracle Full Client
7
+ installations.
8
+
9
+ For Oracle Instant Client, look at {file:docs/install-instant-client.md}.
10
+ For Windows, look at {file:docs/install-binary-package.md} unless you
11
+ have a special need to compile ruby-oci8 by yourself.
12
+
13
+ Check the environment
14
+ =====================
15
+
16
+ Oracle installation
17
+ -------------------
18
+
19
+ Run the following command and confirm it works fine. If it doesn't
20
+ work well, you need to ask to your database administrator.
21
+
22
+ sqlplus USERNAME/PASSWORD
23
+
24
+ ruby installation
25
+ -----------------
26
+
27
+ Run the following command. If it ends with "can't find header files
28
+ for ruby" or "ruby: no such file to load -- mkmf (LoadError)", you need
29
+ to install ruby-devel(redhat) or ruby-dev(debian/ubuntu).
30
+
31
+ ruby -r mkmf -e ""
32
+
33
+ development tools
34
+ -----------------
35
+
36
+ You need a C compiler and development tools such as make or nmake.
37
+ Note that they must be same with ones used to compile the ruby.
38
+ For example, you need Oracle Solaris Studio, not gcc, for ruby
39
+ compiled by Oracle Solaris Studio.
40
+
41
+ Installation
42
+ ============
43
+
44
+ If you get a problem in the following steps, look at {file:docs/platform-specific-issues.md}
45
+ and {file:docs/report-installation-issue.md}.
46
+
47
+ Set the library search path
48
+ ---------------------------
49
+
50
+ ### UNIX
51
+
52
+ Set the library search path, whose name depends on the OS, to point to
53
+ $ORACLE\_HOME/lib. If the database is 64-bit and the ruby is 32-bit,
54
+ use $ORACLE\_HOME/lib32 instead.
55
+
56
+ <table style="border: 1px #E3E3E3 solid; border-collapse: collapse; border-spacing: 0;">
57
+ <thead>
58
+ <tr><th> OS </th><th> library search path </th></tr>
59
+ </thead>
60
+ <tbody>
61
+ <tr><td> Linux </td><td> LD_LIBRARY_PATH </td></tr>
62
+ <tr><td> Solaris 32-bit ruby </td><td> LD_LIBRARY_PATH_32 or LD_LIBRARY_PATH </td></tr>
63
+ <tr><td> Solaris 64-bit ruby </td><td> LD_LIBRARY_PATH_64 or LD_LIBRARY_PATH </td></tr>
64
+ <tr><td> HP-UX PA-RISC 32-bit ruby </td><td> SHLIB_PATH </td></tr>
65
+ <tr><td> HP-UX PA-RISC 64-bit ruby </td><td> LD_LIBRARY_PATH </td></tr>
66
+ <tr><td> HP-UX IA64 </td><td> LD_LIBRARY_PATH </td></tr>
67
+ <tr><td> Mac OS X </td><td> DYLD_LIBRARY_PATH </td></tr>
68
+ <tr><td> AIX </td><td> LIBPATH </td></tr>
69
+ </tbody>
70
+ </table>
71
+
72
+ Do not forget to export the variable as follows:
73
+
74
+ $ LD_LIBRARY_PATH=$ORACLE_HOME/lib
75
+ $ export LD_LIBRARY_PATH
76
+
77
+ ### Windows(mswin32, mingw32, cygwin)
78
+
79
+ If sqlplus runs correctly, library search path has no problem.
80
+
81
+ gem package
82
+ -----------
83
+
84
+ Run the following command.
85
+
86
+ gem install ruby-oci8
87
+
88
+ tar.gz package
89
+ --------------
90
+
91
+ ### Download the source code
92
+
93
+ Download the latest tar.gz package such as ruby-oci8 2.1.0.tar.gz,
94
+ which is the latest version at the time of writing, from [rubyforge][].
95
+
96
+ ### Run make and install
97
+
98
+ #### UNIX or Windows(mingw32, cygwin)
99
+
100
+ gzip -dc ruby-oci8-VERSION.tar.gz | tar xvf -
101
+ cd ruby-oci8-VERSION
102
+ make
103
+ make install
104
+
105
+ note: If you use '`sudo`', use it only when running '`make install`'.
106
+ '`sudo`' doesn't pass library search path to the executing command for security reasons.
107
+
108
+ #### Windows(mswin32)
109
+
110
+
111
+ gzip -dc ruby-oci8-VERSION.tar.gz | tar xvf -
112
+ cd ruby-oci8-VERSION
113
+ nmake
114
+ nmake install
115
+
116
+ [rubyforge]: http://rubyforge.org/frs/?group_id=256
@@ -0,0 +1,167 @@
1
+ # @title Install for Oracle Instant Client
2
+
3
+ Introduction
4
+ ============
5
+
6
+ This page explains the way to install ruby-oci8 for Oracle Instant Client.
7
+
8
+ For Oracle Full Client, look at {file:docs/install-full-client.md}.
9
+ For Windows, look at {file:docs/install-binary-package.md} unless you
10
+ have a special need to compile ruby-oci8 by yourself.
11
+
12
+ Install Oracle Instant Client Packages
13
+ ======================================
14
+
15
+ Donwload Instant Client Packages
16
+ --------------------------------
17
+ Download the following packages from [Oracle Technology Network](http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html).
18
+
19
+ * Instant Client Package - Basic or Basic Lite
20
+ * Instant Client Package - SDK
21
+ * Instant Client Package - SQL*Plus
22
+
23
+ Note: use 32-bit packages for 32-bit ruby even though the OS is 64-bit.
24
+
25
+ UNIX zip packages
26
+ -----------------
27
+
28
+ Unzip the packages as follows:
29
+
30
+ mkdir /opt
31
+ mkdir /opt/oracle
32
+ cd /opt/oracle
33
+ unzip path/to/instantclient-basic-OS-VERSION.zip
34
+ unzip path/to/instantclient-sdk-OS-VERSION.zip
35
+ unzip path/to/instantclient-sqlplus-OS-VERSION.zip
36
+
37
+ If /opt/oracle/instantclient10_1/libclntsh.so is not found, make
38
+ a symbolic link to link the library.
39
+
40
+ cd /opt/oracle/instantclient10_1
41
+ ln -s libclntsh.so.10.1 libclntsh.so
42
+
43
+ Note:
44
+
45
+ * use libclntsh.sl instead of libclntsh.so on HP-UX PA-RISC.
46
+ * use libclntsh.dylib instead of libclntsh.so on Mac OS X.
47
+ * skip this step for AIX.
48
+
49
+ Set the library search path, whose name depends on the OS, to point to
50
+ the installed directory.
51
+
52
+ <table style="border: 1px #E3E3E3 solid; border-collapse: collapse; border-spacing: 0;">
53
+ <thead>
54
+ <tr><th> OS </th><th> library search path </th></tr>
55
+ </thead>
56
+ <tbody>
57
+ <tr><td> Linux </td><td> LD_LIBRARY_PATH </td></tr>
58
+ <tr><td> Solaris 32-bit ruby </td><td> LD_LIBRARY_PATH_32 or LD_LIBRARY_PATH </td></tr>
59
+ <tr><td> Solaris 64-bit ruby </td><td> LD_LIBRARY_PATH_64 or LD_LIBRARY_PATH </td></tr>
60
+ <tr><td> HP-UX PA-RISC 32-bit ruby </td><td> SHLIB_PATH </td></tr>
61
+ <tr><td> HP-UX PA-RISC 64-bit ruby </td><td> LD_LIBRARY_PATH </td></tr>
62
+ <tr><td> HP-UX IA64 </td><td> LD_LIBRARY_PATH </td></tr>
63
+ <tr><td> Mac OS X </td><td> DYLD_LIBRARY_PATH </td></tr>
64
+ <tr><td> AIX </td><td> LIBPATH </td></tr>
65
+ </tbody>
66
+ </table>
67
+
68
+ For example:
69
+ $ LD_LIBRARY_PATH=/opt/oracle/instantclient_10_2
70
+ $ export LD_LIBRARY_PATH
71
+
72
+ Linux rpm packages
73
+ ------------------
74
+
75
+ Install the downloaded packages as follows:
76
+
77
+ rpm -i path/to/oracle-instantclient-basic-VERSION-ARCH.rpm
78
+ rpm -i path/to/oracle-instantclient-devel-VERSION-ARCH.rpm
79
+ rpm -i path/to/oracle-instantclient-sqlplus-VERSION-ARCH.rpm
80
+
81
+ Set LD_LIBRARY_PATH to point to the directory where libclntsh.so is installed.
82
+
83
+ For example:
84
+ $ LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client/lib
85
+ $ export LD_LIBRARY_PATH
86
+
87
+ Windows
88
+ -------
89
+
90
+ Unzip the packages and set PATH to point to the directory where OCI.DLL is installed.
91
+
92
+ Check the environment
93
+ =====================
94
+
95
+ Oracle installation
96
+ -------------------
97
+
98
+ Run the following command and confirm it works fine. If it doesn't
99
+ work well, check LD\_LIBRARY\_PATH or PATH.
100
+
101
+ sqlplus USERNAME/PASSWORD
102
+
103
+ ruby installation
104
+ -----------------
105
+
106
+ Run the following command. If it ends with "can't find header files
107
+ for ruby" or "ruby: no such file to load -- mkmf (LoadError)", you need
108
+ to install ruby-devel(redhat) or ruby-dev(debian/ubuntu).
109
+
110
+ ruby -r mkmf -e ""
111
+
112
+ development tools
113
+ -----------------
114
+
115
+ You need a C compiler and development tools such as make or nmake.
116
+ Note that they must be same with ones used to compile the ruby.
117
+ For example, you need Oracle Solaris Studio, not gcc, for ruby
118
+ compiled by Oracle Solaris Studio.
119
+
120
+ Installation
121
+ ============
122
+
123
+ If you get a problem in the following steps, look at {file:docs/platform-specific-issues.md}
124
+ and {file:docs/report-installation-issue.md}.
125
+
126
+ gem package
127
+ -----------
128
+
129
+ Run the following command.
130
+
131
+ gem install ruby-oci8
132
+
133
+ If you get a problem, look at {file:docs/platform-specific-issues.md}
134
+ and {file:docs/report-installation-issue.md}.
135
+
136
+ tar.gz package
137
+ --------------
138
+
139
+ ### Download the source code
140
+
141
+ Download the latest tar.gz package such as ruby-oci8 2.1.0.tar.gz,
142
+ which is the latest version at the time of writing, from [rubyforge][].
143
+
144
+ Note: if you are using Windows and you have no special need to compile
145
+ it by yourself, look at {file:docs/install-binary-packge.md}.
146
+
147
+ ### Run make and install
148
+
149
+ #### UNIX or Windows(mingw32, cygwin)
150
+
151
+ gzip -dc ruby-oci8-VERSION.tar.gz | tar xvf -
152
+ cd ruby-oci8-VERSION
153
+ make
154
+ make install
155
+
156
+ note: If you use '`sudo`', use it only when running '`make install`'.
157
+ '`sudo`' doesn't pass library search path to the executing command for security reasons.
158
+
159
+ #### Windows(mswin32)
160
+
161
+
162
+ gzip -dc ruby-oci8-VERSION.tar.gz | tar xvf -
163
+ cd ruby-oci8-VERSION
164
+ nmake
165
+ nmake install
166
+
167
+ [rubyforge]: http://rubyforge.org/frs/?group_id=256
@@ -0,0 +1,209 @@
1
+ # @title Platform Specific Issues
2
+
3
+ Linux
4
+ =====
5
+
6
+ Ubuntu 11.10 (Oneiric Ocelot)
7
+ -----------------------------
8
+
9
+ If the following error occurs even though libc6-dev is installed,
10
+
11
+ Do you install glibc-devel(redhat) or libc6-dev(debian)?
12
+ You need /usr/include/sys/types.h to compile ruby-oci8.
13
+
14
+ You need to use ruby-oci8 2.1.0 or upper. Otherwise, run the following command and re-install ruby-oci8.
15
+
16
+ $ sudo ln -s /usr/include/linux/ /usr/include/sys
17
+
18
+ General Linux
19
+ -------------
20
+
21
+ Use the same bit-width of libraries with ruby. For example, x86\_64
22
+ instant client for x86\_64 ruby and 32-bit instant client for 32-bit
23
+ ruby. It depends on the ruby but not on the OS. As for full client,
24
+ x86\_64 ruby cannot use with 32-bit full client, but 32-bit ruby can
25
+ use with 64-bit full client because 32-bit libraries are in
26
+ $ORACLE\_HOME/lib32.
27
+
28
+ To check which type of ruby do you use:
29
+
30
+ file `which ruby`
31
+
32
+ Note: "`" is a back quote.
33
+
34
+ Mac OS X
35
+ ========
36
+
37
+ OS X 10.7 Lion
38
+ --------------
39
+
40
+ 64-bit instant client doesn't work. Use 32-bit ruby and instant client or jruby.
41
+
42
+ See:
43
+
44
+ * {http://rubyforge.org/forum/forum.php?thread\_id=49548&forum\_id=1078}
45
+ * {https://forums.oracle.com/forums/thread.jspa?threadID=2187558}
46
+
47
+ Intel Mac (64-bit)
48
+ ------------------
49
+
50
+ See [How to setup Ruby and Oracle Instant Client on Snow Leopard](http://blog.rayapps.com/2009/09/06/how-to-setup-ruby-and-oracle-instant-client-on-snow-leopard/).
51
+ Note that setting the environment variable RC\_ARCHS=x86\_64 instead of ARCHFLAGS="-arch x86\_64" will work fine also.
52
+
53
+ Intel Mac (32-bit)
54
+ ------------------
55
+
56
+ See [How to setup Ruby and Oracle Instant Client on Snow Leopard](http://blog.rayapps.com/2009/09/06/how-to-setup-ruby-and-oracle-instant-client-on-snow-leopard/). Note that you need to replace x86\_64 with i386 in the blog.
57
+
58
+ The Intel Instant client is for Mac OS X 10.5 Leopard. If you are using 10.4 Tiger,
59
+ use one of the following workarounds.
60
+
61
+ * compile ruby as ppc. (look at [How to setup Ruby and Oracle client on Intel Mac](http://blog.rayapps.com/2007/08/27/how-to-setup-ruby-and-oracle-client-on-intel-mac/))
62
+ * use [ruby-odbc|http://www.ch-werner.de/rubyodbc/] and a third party ODBC driver ([Actual Technologies](http://www.actualtechnologies.com) or [OpenLink Software](http://uda.openlinksw.com/)).
63
+ * use JRuby and Oracle JDBC driver.
64
+
65
+ PowerPC Mac
66
+ -----------
67
+
68
+ See [How to setup Ruby and Oracle Instant Client on Snow Leopard](http://blog.rayapps.com/2009/09/06/how-to-setup-ruby-and-oracle-instant-client-on-snow-leopard/). Note that you need to replace x86\_64 with ppc in the blog.
69
+
70
+ Solaris
71
+ =======
72
+
73
+ You need a same compiler which is used to make ruby itself.
74
+
75
+ There are two ruby packages.
76
+
77
+ * [Sunfreeware.com](http://www.sunfreeware.com/)
78
+ * [Blastwave.org](http://www.blastwave.org/)
79
+
80
+ The former is compiled by gcc. The latter is compiled by
81
+ [Sun Studio](http://developers.sun.com/sunstudio/).
82
+ The both compilers are freely available.
83
+
84
+ If you use Blastwave.org's ruby and want not to install Sun Studio,
85
+ you can edit rbconfig.rb by your self. [(look at here)](http://forum.textdrive.com/viewtopic.php?id=12630)
86
+
87
+ If you use Sunfreeware.com's ruby and
88
+
89
+ $ ruby -r rbconfig -e "p Config::CONFIG['GNU_LD']"
90
+
91
+ prints "yes", you may need to edit rbconfig.rb distributed with the ruby
92
+ as follows:
93
+
94
+ from: CONFIG["LDFLAGS"] = "-L. -Wl,-E"
95
+ to: CONFIG["LDFLAGS"] = "-L. "
96
+
97
+ FreeBSD
98
+ =======
99
+
100
+ There are two ways.
101
+
102
+ * use ruby and instant client on linux emulator
103
+ * use oracle8-client port
104
+
105
+ linux emulator
106
+ --------------
107
+
108
+ I have not run ruby-oci8 on linux emulator, but I guess it will
109
+ run as follows. If it works, please tell me.
110
+
111
+ If FreeBSD has a cross-compiler which can generate linux binaries,
112
+ use it to compile ruby and ruby-oci8.
113
+
114
+ If FreeBSD doesn't have such a compiler, install a linux distribution
115
+ which FreeBSD can emulate to a PC machine, make ruby and ruby-oci8 in
116
+ the linux box and copy them to the FreeBSD box as follows.
117
+
118
+ On linux:
119
+
120
+ # make ruby
121
+ tar xvfz ruby-1.8.x.tar.gz
122
+ cd ruby-1.8.x
123
+ ./configure --prefix=/usr/local/ruby-1.8.x --enable-pthread
124
+ make
125
+ make install
126
+ # setup instant client
127
+ ....
128
+ # make ruby-oci8
129
+ PATH=/usr/local/ruby-1.8.x/bin:$PATH
130
+ tar xvfz ruby-oci8-1.0.x.tar.gz
131
+ cd ruby-oci8-1.0.x
132
+ make
133
+ make install
134
+ cd /usr/local/
135
+ tar cvfz ruby-1.8.x-linux.tar.gz ruby-1.8.x
136
+
137
+ Copy ruby-1.8.x-linux.tar.gz to the FreeBSD box.
138
+
139
+ On freebsd:
140
+
141
+ cd /compat/linux/usr/local
142
+ tar xvfz ruby-1.8.x-linux.tar.gz
143
+
144
+ oracle8-client port
145
+ -------------------
146
+
147
+ I don't recommend this because of the following two reasons.
148
+
149
+ * The oracle8-client port is made from Oracle 8.1.7.1 static library for Linux. Oracle have not supported the connectivity between 8.1.7.1 and Oracle 10g.
150
+ * It is very unstable. When it fails to connect to an Oracle server, it is down by segmentation fault on FreeBSD 7.0 not only when using ruby-oci8, but also by a very simple test code written by C.
151
+
152
+ If you try to use oracle8-client port, compile and install as follows.
153
+
154
+ * install oracle8-client
155
+
156
+ cd /usr/ports/databases/oracle8-client
157
+ make
158
+ make install
159
+
160
+ * set an environment variable ORACLE\_HOME
161
+
162
+ export ORACLE_HOME=/usr/local/oracle8-client
163
+
164
+ The rest steps are described at {file:docs/install-full-client.md}.
165
+
166
+ note: You have no need to set LD\_LIBRARY\_PATH because
167
+ Oracle libraries in oracle8-client port are static ones.
168
+
169
+ HP-UX
170
+ =====
171
+
172
+ You need a ruby which is linked with ''libpthread'' and ''libcl''.
173
+
174
+ Run `configure`.
175
+
176
+ tar xvfz ruby-1.9.x.tar.gz
177
+ cd ruby-1.9.x
178
+ ./configure
179
+
180
+ Then open `Makefile` to add '-lpthread -lcl' to `LIBS` and run `make`
181
+ and `make install`.
182
+
183
+ make
184
+ make install
185
+
186
+ The rest steps are described at {file:docs/install-full-client.md}.
187
+
188
+ Windows
189
+ =======
190
+
191
+ On some machines using a slow disk, you may get the following error.
192
+
193
+ Permission denied - conftest.exe
194
+
195
+ Edit mkmf.rb for a workaround.
196
+
197
+ def try_run(src, opt="")
198
+ if try_link0(src, opt)
199
+ xsystem("./conftest")
200
+ else
201
+ nil
202
+ end
203
+ ensure
204
+ # add the following one line.
205
+ sleep 1 if /mswin32|cygwin|mingw32|bccwin32/ =~ RUBY_PLATFORM
206
+ rm_f "conftest*"
207
+ end
208
+
209
+ See also: {http://abstractplain.net/blog/?p=788}.