« Mac de Ruby on Rails - #10 - IntelMac編 #1 | トップページ | Mac de Ruby on Rails - #12 - IntelMac編 #3 »

2008年6月15日 (日)

Mac de Ruby on Rails - #11 - IntelMac編 #2

さて、つづきです。ruby-oci8をインストールする。(ruby-oci8は、1.0.0を事前にダウンロードしておいた。尚、本記事を書いている時点では、1.0.1が最新。)

まず、make。

Macintosh:˜ discus$ ll
total 216
drwx------+ 32 discus staff 1088 6 8 23:25 Desktop
drwx------+ 10 discus staff 340 1 3 01:32 Documents
drwx------+ 14 discus staff 476 6 8 23:26 Downloads
drwxr-xr-x 10 discus staff 340 12 19 16:03 Image Browser
drwxr-xr-x 10 discus staff 340 12 19 16:57 Image Kit Browser
drwx------+ 32 discus staff 1088 3 1 14:07 Library
drwx------+ 3 discus staff 102 11 26 2007 Movies
drwx------+ 4 discus staff 136 2 2 11:12 Music
drwx------+ 9 discus staff 306 6 14 05:21 Pictures
drwxr-xr-x+ 5 discus staff 170 11 26 2007 Public
drwxr-xr-x+ 5 discus staff 170 11 26 2007 Sites
drwxr-xr-x 16 discus staff 544 11 25 2007 ruby-oci8-1.0.0
-rw-r--r-- 1 discus staff 107494 3 2 02:27 ruby-oci8-1.0.0.tar.gz
Macintosh:˜ discus$ cd ruby-oci8-1.0.0
Macintosh:ruby-oci8-1.0.0 discus$ make
ruby setup.rb config
---> lib
---> lib/DBD
---> lib/DBD/OCI8
<--- lib/DBD/OCI8
<--- lib/DBD
<--- lib
---> ext
---> ext/oci8
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby /Users/discus/ruby-oci8-1.0.0/ext/oci8/extconf.rb
checking for load library path... (DYLD_LIBRARY_PATH)...
found: /Users/Shared/OracleInstantClient/libclntsh.dylib.10.1 looks like an instant client.
checking for cc... ok
checking for gcc... yes
checking for LP64... no
checking for ruby header... ok
checking for OCIInitialize() in oci.h... no
---------------------------------------------------
error messages:
Could not compile with Oracle instant client.
You may need to set a environment variable:
DYLD_LIBRARY_PATH=/Users/Shared/OracleInstantClient
export DYLD_LIBRARY_PATH

---------------------------------------------------
See:
* http://ruby-oci8.rubyforge.org/ja/HowToInstall.html
* http://ruby-oci8.rubyforge.org/ja/ReportInstallProblem.html

*** /Users/discus/ruby-oci8-1.0.0/ext/oci8/extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=/Users/discus/ruby-oci8-1.0.0/ext/oci8
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
--with-instant-client
--without-instant-client
/Users/discus/ruby-oci8-1.0.0/ext/oci8/oraconf.rb:941:in `initialize': RuntimeError (RuntimeError)
from /Users/discus/ruby-oci8-1.0.0/ext/oci8/oraconf.rb:236:in `new'
from /Users/discus/ruby-oci8-1.0.0/ext/oci8/oraconf.rb:236:in `get'
from /Users/discus/ruby-oci8-1.0.0/ext/oci8/extconf.rb:6
'system /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby /Users/discus/ruby-oci8-1.0.0/ext/oci8/extconf.rb ' failed
Try 'ruby setup.rb --help' for detailed usage.
make: *** [config.save] Error 1
Macintosh:ruby-oci8-1.0.0 discus$

checking for OCIInitialize() in oci.h... noというエラーが出てmakeできない。いろいろ調べてみたら、ruby-oci8 1.0.0はInteli386アーキテクチャのみ有効なようなので、以下のようにコンパイルオプションに"-arch i386"を追加すればインストールできるとのこと。
以下のサイトを参考にさせてもらった。
http://blog.rayapps.com/2008/04/24/how-to-setup-ruby-and-new-oracle-instant-client-on-leopard/

ということで再make。

Macintosh:ruby-oci8-1.0.0 discus$ export ARCHFLAGS="-arch i386"
Macintosh:ruby-oci8-1.0.0 discus$ make
ruby setup.rb config
---> lib
---> lib/DBD
---> lib/DBD/OCI8
<--- lib/DBD/OCI8
<--- lib/DBD
<--- lib
---> ext
---> ext/oci8
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby /Users/discus/ruby-oci8-1.0.0/ext/oci8/extconf.rb
checking for load library path... (DYLD_LIBRARY_PATH)...
found: /Users/Shared/OracleInstantClient/libclntsh.dylib.10.1 looks like an instant client.
checking for cc... ok
checking for gcc... yes
checking for LP64... no
checking for ruby header... ok
checking for OCIInitialize() in oci.h... yes
checking for OCIEnvCreate()... yes
checking for OCITerminate()... yes
checking for OCILobOpen()... yes
checking for OCILobClose()... yes
checking for OCILobCreateTemporary()... yes
checking for OCILobGetChunkSize()... yes
checking for OCILobLocatorAssign()... yes
creating ../../lib/oci8.rb from /Users/discus/ruby-oci8-1.0.0/ext/oci8/../../lib/oci8.rb.in
creating extconf.h
creating Makefile
<--- ext/oci8
<--- ext
ruby setup.rb setup
---> lib
---> lib/DBD
---> lib/DBD/OCI8
<--- lib/DBD/OCI8
<--- lib/DBD
<--- lib
---> ext
---> ext/oci8
make
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I/Users/discus/ruby-oci8-1.0.0/ext/oci8 -DRUBY_EXTCONF_H=\"extconf.h\" -fno
-common -arch i386 -Os -pipe -fno-common -I/Users/Shared/OracleInstantClient/sdk/include -Wall -c oci8.c

・・・・中略・・・・

cc -arch i386 -pipe -bundle -undefined dynamic_lookup -o oci8lib.bundle oci8.o handle.o const.o env.o error.o svcctx.o server.o session.o
stmt.o define.o bind.o describe.o descriptor.o param.o lob.o oradate.o oranumber.o ocinumber.o attr.o -L"." -L"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib" -L.
-arch i386 -lruby -L/Users/Shared/OracleInstantClient -lclntsh -lpthread -ldl -lm
<--- ext/oci8
<--- ext
Macintosh:ruby-oci8-1.0.0 discus$
Macintosh:ruby-oci8-1.0.0 discus$ sudo make install
Password:
ruby setup.rb install
---> lib
mkdir -p /Library/Ruby/Site/1.8/
install oci8.rb /Library/Ruby/Site/1.8/
---> lib/DBD
mkdir -p /Library/Ruby/Site/1.8/DBD
---> lib/DBD/OCI8
mkdir -p /Library/Ruby/Site/1.8/DBD/OCI8
install OCI8.rb /Library/Ruby/Site/1.8/DBD/OCI8
<--- lib/DBD/OCI8
<--- lib/DBD
<--- lib
---> ext
---> ext/oci8
mkdir -p /Library/Ruby/Site/1.8/universal-darwin9.0/.
install oci8lib.bundle /Library/Ruby/Site/1.8/universal-darwin9.0/.
<--- ext/oci8
<--- ext
Macintosh:ruby-oci8-1.0.0 discus$


少々注意する点はあるがそれ以外は順調、順調。



バックナンバー:Mac de Ruby on Rails - #10 - IntelMac編 #1


|

トラックバック


この記事へのトラックバック一覧です: Mac de Ruby on Rails - #11 - IntelMac編 #2:

コメント

コメントを書く