foldrr's weblog

旧ブログ http://d.hatena.ne.jp/foldrr/

CORESERVER へ Rails をインストール

.bashrc を編集して環境変数 RUBYLIB, GEM_HOME を設定する。

export RUBYLIB=$HOME/lib:$HOME/lib/ruby
export GEM_HOME=$HOME/lib/ruby/gem

source で反映するのを忘れずに。

$ source .bashrc

http://rubyforge.org/projects/rubygems/ を見に行き、リリースとダウンロードするアドレスを確認し、確認したアドレスのパッケージをダウンロードする。

RubyGems 1.3.1 の場合
$ wget wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz

ダウンロードしたパッケージを展開する。

$ tar xzvf rubygems-1.3.1.tgz

展開したディレクトリに移動し、インストールする。

$ cd rubygems-1.3.1
$ ruby setup.rb --prefix=$HOME
$ rehash

RubyGems をインストールできたか確認する。

$ ~/lib/ruby/bin/gem -v
1.3.1

Rails をインストールする。
CORESERVER にプロセスを kill されてしまう場合がある。
kill されてしまったら、もう一度やってみる。

$ gem install rails --include-dependencies
INFO:  `gem install -y` is now default and will be removed
INFO:  use --ignore-dependencies to install only the gems you list
Successfully installed rake-0.8.4
Successfully installed activesupport-2.3.2
Successfully installed activerecord-2.3.2
Successfully installed actionpack-2.3.2
Successfully installed actionmailer-2.3.2
Successfully installed activeresource-2.3.2
Successfully installed rails-2.3.2
7 gems installed
Installing ri documentation for rake-0.8.4...
Installing ri documentation for activesupport-2.3.2...
Installing ri documentation for activerecord-2.3.2...
Installing ri documentation for actionpack-2.3.2...
Installing ri documentation for actionmailer-2.3.2...
Installing ri documentation for activeresource-2.3.2...
Installing RDoc documentation for rake-0.8.4...
Installing RDoc documentation for activesupport-2.3.2...
Installing RDoc documentation for activerecord-2.3.2...
Installing RDoc documentation for actionpack-2.3.2...
Installing RDoc documentation for actionmailer-2.3.2...
Installing RDoc documentation for activeresource-2.3.2...

再度 .bashrc を編集して環境変数 PATH を設定する。

export PATH=$PATH:$HOME/bin:$HOME/lib/ruby/gem/bin

Rails をインストールできたか確認する。

$ rails -v
Rails 2.3.2

注意

このままでは CORESERVER 標準の Ruby 1.8.5 で実行されてしまう。
Ruby 1.8.7 以上をインストールし。
shebang を変更すること。