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

2008年6月22日 (日)

Mac de Ruby on Rails - #13 - IntelMac編 #4

前回のつづき旧バージョンが悪さをしているようなのでこの際、残っている古いバージョンをuninstallしてしまえ! ということに。
尚、Leopardでは事前にRoRが/System/Library/Frameworks/Ruby.framework/以下にインストールされている。


Macintosh:test discus$ sudo gem uninstall activerecord --install-dir=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8

Select gem to uninstall:
1. activerecord-1.15.3
2. activerecord-1.15.6
3. activerecord-2.1.0
4. All versions
> 2

You have requested to uninstall the gem:
activerecord-1.15.6
actionwebservice-1.2.6 depends on [activerecord (= 1.15.6)]
rails-1.2.6 depends on [activerecord (= 1.15.6)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn] Y
Successfully uninstalled activerecord-1.15.6
Macintosh:test discus$ ruby test.rb
/Library/Ruby/Site/1.8/rubygems.rb:139:in `activate': can't activate activerecord (= 1.15.3), already activated activerecord-2.1.0] (Gem::Exception)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in `require'
from /Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in `establish_connection'
from test.rb:8
Macintosh:test discus$ sudo gem uninstall activerecord --install-dir=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8

Select gem to uninstall:
1. activerecord-1.15.3
2. activerecord-2.1.0
3. All versions
> 1

You have requested to uninstall the gem:
activerecord-1.15.3
actionwebservice-1.2.3 depends on [activerecord (= 1.15.3)]
rails-1.2.3 depends on [activerecord (= 1.15.3)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn] Y
Successfully uninstalled activerecord-1.15.3
Macintosh:test discus$ ruby test.rb
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:232:in `establish_connection': Please install the oracle adapter:
`gem install activerecord-oracle-adapter` (no such file to load -- active_record/connection_adapters/oracle_adapter) (RuntimeError)
from test.rb:8
Macintosh:test discus$
Macintosh:test discus$

お〜〜〜、忘れていました。 oracle_adapter.rbを。

ということで、oracle_adapter.rbをダウンロード後、/Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters以下へコピー。

Macintosh:test discus$ 
Macintosh:test discus$ curl -O http://svn.rubyonrails.org/rails/adapters/oracle/lib/active_record/connection_adapters/oracle_adapter.rb
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 27847 100 27847 0 0 28714 0 --:--:-- --:--:-- --:--:-- 66645
Macintosh:test discus$ ll
total 64
drwxr-xr-x 15 discus staff 510 6 14 07:31 emp_list
-rw-r--r-- 1 discus staff 27847 6 14 09:43 oracle_adapter.rb
-rw-r--r-- 1 discus staff 325 6 14 09:13 test.rb
Macintosh:test discus$ sudo cp oracle_adapter.rb /Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters
Password:
Macintosh:test discus$
Macintosh:test discus$


再度、テストプログラムを実行。

Macintosh:test discus$ ruby test.rb
7934, MILLER,CLERK

動いた!。
ということで次回へつづく。



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


|

トラックバック


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

コメント

コメントを書く