mac に ruby インストール
Tigerには既に ruby が入ってるのがだが、versionがちょっと古いので新しいのを入れ直す。入れる方法は、いつもの通り、MacPortsを使用。一応バージョンなんかを確認。
# port info ruby ruby 1.8.6-p110, lang/ruby (Variants: universal, darwin, darwin_9, tk, mactk, thread_hooks) http://www.ruby-lang.org/ Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, extensible, and portable. Library Dependencies: libiconv, readline, openssl, zlib, ncurses Platforms: darwin Maintainers: pguyot@kallisys.net
現時点では1.8.6のパッチ110。うむ。問題なし。で、インストール
# port install ruby
ついでに、railなんかを入れるためにも rubygemsと、Apacheで使うために mod_rubyもインストールするため、パッケージを調べる。
# port search gems rb-gem_plugin ruby/rb-gem_plugin 0.2.2 A plugin system based only on rubygems that uses dependencies only. rb-rubygems ruby/rb-rubygems 0.9.4 a package management framework for Ruby # port search mod_ruby mod_ruby www/mod_ruby 1.2.6 apache2 module embedding the Ruby interpreter
infoでvariantに必要ようなものがないか確認して、ないので、そのままインストール。
# port install gem # port install mod_ruby
せっかく rubygems 入れたので、ついでに railも入れよう。以前の自分の日記を参照に、インストールを試みる。
# gem install rails --include-dependencies ERROR: While executing gem ... (OpenURI::HTTPError) 404 Not Found
えぇ!? Not Found?そんなバカな。gem -help とか gem install help とかみてみると、なんかオプションに -r(リモート)を指定しないといけないっぽい?デフォルトは自分のサーバを見に行くのかな。ついでに --include-dependencies は -y で OK なことも知りちょとラッキー。
# gem install rails -y -r
今度はうまくいったみたいだ。無事インストール終了(たぶん)