ruby gem と snowleopardのくそっぷりを感じる

ただいまrails開発をしているのだが、snowleopard にかえてから、なんか動かなくなった。
解決方法のメモ(解決するのか??)

とりあえずググってみたら、
1:http://d.hatena.ne.jp/mizchi/20090827/1251358228 とこや

2:http://journal.mycom.co.jp/news/2009/09/01/033/index.html

とか出てきて、1:からやってみた。

portは入れてないっぽいので、パス

#これは、絶対やっとけー
5. Remove vendor gems (gem uninstall refuses to remove them and fails to do batch remove):
$ gem list | cut -d” ” -f1 > installed_gems

6. Uninstall all gems
$ sudo gem list | cut -d” ” -f1 | xargs sudo gem uninstall -aIx

ここで、なにやらアンインストールできなlibが出てきて、続行できない><

2:のサイトで進めてみたが、まず何をしたいのか理解不明である。

んで、gemのリポジトリをクリアして入れ直すことにした。

$gem environment

RubyGems Environment:
- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-10
- GEM PATHS:
- /Library/Ruby/Gems/1.8
- /Users/smokinatom/.gem/ruby/1.8
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org/

なので、
- GEM PATHS:
以下にある、1.8のフォルダを->1.8_back としてmvする

$ sudo gem list

LOCAL GEMS ***

っときれいさっぱりなくなる。

##再インストールする必要はないと思われるが一応。
http://rubyforge.org/frs/?group_id=126
から最新のgemを取得する

んで解凍して、
$sudo ruby setup.rb

$ gem -v
1.3.5

#パッケージ再インストール
$ sudo cat installed_gems | xargs sudo gem install
ってしたら、なんかやたらエラーがでるぞ。。

Building native extensions. This could take a while...
ERROR: Error installing rubynode:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rubynode-0.1.5 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/rubynode-0.1.5/ext/rubynode_ext/gem_make.out

どこまでが、一つのログなのかさっぱりしないのだが、とりあえずruby.hが見つからないとか言ってるのか〜?

っと思ったらですね。結局

1:の
1. Install the latest Xcode shipped with Snow Leopard.

ってのが、原因っぽかった。
裏でインストールしながら、進めていたんだが、終わった後に

sudo env ARCHFLAGS="-arch x86_64"
して

cat installed_gems | xargs sudo gem install --no-ri --no-rdoc

で、うまくできたっぽい

っとおもったら

uccessfully installed actionmailer-2.3.4
Successfully installed actionpack-2.3.4
Successfully installed actionwebservice-1.2.6
Successfully installed activerecord-2.3.4
Successfully installed activeresource-2.3.4
Successfully installed activesupport-2.3.4
Successfully installed acts_as_ferret-0.4.4
Successfully installed capistrano-2.5.9
Successfully installed cgi_multipart_eof_fix-2.5.0
Successfully installed daemons-1.0.10
Building native extensions. This could take a while...
Successfully installed dnssd-1.3
Building native extensions. This could take a while...
Successfully installed fastthread-1.0.7
Building native extensions. This could take a while...
Successfully installed fcgi-0.8.7
Building native extensions. This could take a while...
Successfully installed ferret-0.11.6
Successfully installed gem_plugin-0.2.3
Successfully installed highline-1.5.1
Building native extensions. This could take a while...
Successfully installed hpricot-0.8.1
Building native extensions. This could take a while...
Successfully installed libxml-ruby-1.1.3
Building native extensions. This could take a while...
Successfully installed linecache-0.43
Building native extensions. This could take a while...
Successfully installed mongrel-1.1.5
Successfully installed needle-1.3.0
Successfully installed net-scp-1.0.2
Successfully installed net-sftp-2.0.2
Successfully installed net-ssh-2.0.15
Successfully installed net-ssh-gateway-1.0.1
Successfully installed rack-1.0.0
Successfully installed rails-2.3.4
Successfully installed rake-0.8.7
Building native extensions. This could take a while...
Successfully installed RedCloth-4.2.2
Building native extensions. This could take a while...
Successfully installed ruby-debug-base-0.10.3
Building native extensions. This could take a while...
Successfully installed ruby-debug-ide-0.4.9
Successfully installed ruby-openid-2.1.7
Successfully installed ruby-yadis-0.3.4
Successfully installed rubygems-update-1.3.5
Building native extensions. This could take a while...
ERROR: Error installing rubynode:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
==================== ERROR =====================
Please set RUBY_SOURCE_DIR to the source path of ruby 1.8.7 (2008-08-11)!
================================================


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rubynode-0.1.5 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/rubynode-0.1.5/ext/rubynode_ext/gem_make.out
Building native extensions. This could take a while...
Successfully installed sqlite3-ruby-1.2.5
Building native extensions. This could take a while...
Successfully installed termios-0.9.4
Successfully installed xmpp4r-0.5
37 gems installed

こいつ rubygems-update-1.3.5 しねこら

$ sudo gem install rubygems-update
Password:
Successfully installed rubygems-update-1.3.5
1 gem installed
Installing ri documentation for rubygems-update-1.3.5...
Installing RDoc documentation for rubygems-update-1.3.5...

できた〜のか〜?

$ rails test
$ ruby script/server

http://localhost:3000/

About your application’s environment
をポッチっとするわけなんだが、全然関係ないけど、safariでここ文字表示おかしなくなってたっけ〜?
なんか変なんだけど、とりあえず、エラーはでてないっぽい

Ruby version 1.8.7 (universal-darwin10.0)
RubyGems version 1.3.5
Rack version 1.0
Rails version 2.3.4
Active Record version 2.3.4
Active Resource version 2.3.4
Action Mailer version 2.3.4
Active Support version 2.3.4
Application root /Users/smokinatom/test
Environment development
Database adapter sqlite3
Database schema version 0

しかし、時間かかりすぎですよ。。。4、5時間もかかってしまった