brain.rbinstance_missing
The nightmare is over.
Just until the latest Oracle libraries update (finally released a X86 library pack for mac) it was nesecerry to use 2 versions of ruby, a universal and a ppc version. Sadly, when running PPC, the benchmarking were terrible and it had some very annoying freezes and other stuff that would simple make you want to jump off the roof.
BUT! (:) ) times had changed, Oracle (as mentioned) released an X86 Intel compatible library pack for MacOs users and therefore ended my misery,
Woohoo! That makes the entire process of connection Ruby on Rails and oracle on Leopard about as 100 times less complicated than before, so I’ve posted it here to let everyone enjoy.
I assumes that you’re using Rails 2.0 or greater (Why not really?).
IMPORTART!!!
If you already connected Oracle and Ruby on Rails using the old way, please preform the “Cleanup” step first.
ln -s libclntsh.dylib.10.1 libclntsh.dylib
export ORACLE_HOME=/Library/Oracle/instantclient_10_2 <= Change to your library!
export TNS_ADMIN=$ORACLE_HOME
export LD_LIBRARY_PATH=$ORACLE_HOME
export DYLD_LIBRARY_PATH=$ORACLE_HOME
export PATH=$PATH:$ORACLE_HOME
sudo gem install activerecord-oracle-adapter —source http://gems.rubyonrails.org
cd ~/Downloads/ruby-oci8-x.×.x
export SQLPATH=$ORACLE_HOME
export RC_ARCHS=i386
ruby setup.rb config
make
sudo make install
irb
require ‘oci8’
> true
irb
require 'rubygems'
> []
require ‘oci8’
> true
development:
adapter: oracle
database: your_instance_name
username: your_user_name
password: your_password
development:
adapter: oci
host: //db_hostname:db_port/xe < Oracle port is usually 1521
username: username
password: password
cursor_sharing: similar
prefetch_rows: 100
cd /usr/bin <== or wherever you put them.
sudo rm ruby
sudo rm ruby_ppc
sudo mv ruby_fat ruby
cd /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin
sudo rm ruby
sudo rm ruby_ppc
sudo mv ruby_fat ruby
sudo rm /usr/bin/ppc_ruby.sh
sudo rm /usr/bin/fat_ruby.sh
| Variable | Value |
|---|---|
| GITHUB | |
| WWR | { :working_with_rails => 'http://www.workingwithrails.com/person/5844-elad-meidar' } |
| IRC | { 'irc.freenode.net' => [ '#rubyonrails', '#railsbridge', '#ruby', '#mootools' ]} |
| SKYPE | eladmeidar |
You're seeing this error because I think it is funny.