MacPort, ruby, の再インストール

rubygemsの更新で、ミスしたらしい

$ sudo gem install solr-ruby
ERROR: While executing gem ... (Gem::RemoteSourceException)
HTTP Response 302

調べてみると、Portまで行方不明

$ port -v
MacPorts 1.9.1

$ sudo port install ruby +thread_hooks +mactk
$ sudo port install rb-rubygems
$ which gem
/opt/local/bin/gem
$ gem -v
1.3.7
$ which ruby
/opt/local/bin/ruby
$ ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [powerpc-darwin8]

  • apache2及びsqlite3のインストール

$ sudo port install apache2
Password:
---> Computing dependencies for apache2
---> Activating apache2 @2.2.17_0+preforkmpm
Error: Target org.macports.activate returned: Image error: /Library/LaunchDaemons/org.macports.apache2.plist already exists and does not belong to a registered port. Unable to activate port apache2. Use 'port -f activate apache2' to force the activation.

    • 上記エラーに対して、指示どおり、強制的なアクティベート

$ sudo port -f activate apache2

$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist

    • インストールしたhttpdにパスが通っているかの確認

$ httpd -v
Server version: Apache/2.2.17 (Unix)
Server built: Nov 6 2010 21:03:32
$ port installed
The following ports are currently installed:
apache2 @2.2.17_0+preforkmpm (active)
apr @1.4.2_1 (active)
apr-util @1.3.9_2 (active)
bzip2 @1.0.6_0 (active)
db46 @4.6.21_6 (active)
expat @2.0.1_1 (active)
gperf @3.0.4_0 (active)
libiconv @1.13.1_0 (active)
ncurses @5.7_1 (active)
ncursesw @5.7_1 (active)
openssl @1.0.0a_1 (active)
pcre @8.10_0 (active)
rb-rubygems @1.3.7_0+ruby (active)
readline @6.1.002_0 (active)
ruby @1.8.7-p302_0+mactk+thread_hooks (active)
sqlite3 @3.7.3_0 (active)
zlib @1.2.5_0 (active)

  • MySQL5サーバ及びクライアントのインストール

$ sudo port mysql5-server