RoRに挑戦!

RubyistMagazineの記事,RubyOnRails を使ってみる 【第 1 回】を読みながら,パワブクにRoRを導入.未だにRoRはよくわかってないけど,勢いが大切.

読んで行くんだけど,チンプンカンプン.とりあえずgemってのが入ってないので,gemってのを入れてみよう!なんでも,gemってのは簡単にRailsをインストールするための手段みたい.ってことは,gemを入れたらRailsを入れたも同じ.


先ず始めに,RubyForgeからRubyGems本体をダウンロード.とりあえず最新版の0.8.11の.tarをゲットし,展開.展開されたディレクトリに移動して,


$sudo ruby setup.rb
を実行.READMEを見れば分かる事ですが,rootじゃないと,パーミッションで怒られます.インストールはコレで終了.速い.インストールされているか確認するときは,コマンドラインからgemと入力し,ゴチャゴチャと出力されたらOKです.


次に,RubyGemsのページを参考に,Railsのインストールをします.


$sudo gem install rails
Attempting local installation of 'rails'
Local gem file not found: rails*.gem
Attempting remote installation of 'rails'
Updating Gem source index for: http://gems.rubyforge.org
Install required dependency rake? [Yn] Y  #とりあえず全部Yで.
Install required dependency activesupport? [Yn] Y
Install required dependency activerecord? [Yn] Y
Install required dependency actionpack? [Yn] Y
Install required dependency actionmailer? [Yn] Y
Install required dependency actionwebservice? [Yn] Y
Successfully installed rails-1.0.0
Successfully installed rake-0.7.0
・・・(略)・・・
Installing RDoc documentation for actionmailer-1.1.5...
Installing RDoc documentation for actionwebservice-1.0.0...
これでRailsのインストールは終了.あのActiveRecordが!みたいな感じで(実は余り分かっていない),一人興奮しました.


次にgemのアップデート.必要ないかな?


$sudo gem install rubygems-update
Attempting local installation of 'rubygems-update'
Local gem file not found: rubygems-update*.gem
Attempting remote installation of 'rubygems-update'
Successfully installed rubygems-update-0.8.11

$sudo update-rubygems
Installing RubyGems 0.8.11

      • > bin

<--- bin
・・・(かなり略)・・・
install validator.rb /opt/local/lib/ruby/site_ruby/1.8/rubygems
install version.rb /opt/local/lib/ruby/site_ruby/1.8/rubygems<--- lib/rubygems<--- lib

As of RubyGems 0.8.0, library stubs are no longer needed.
Searching $LOAD_PATH for stubs to optionally delete (may take a while)...
...done.
No library stubs found.

Successfully built RubyGem
Name: sources
Version: 0.0.1
File: sources-0.0.1.gem

まぁおおかたこんな感じの出力になりますので,参考までに.

さて,バージョンの確認をしてみましょう.最新版を落としたら最後のgemのアップデートは要らないはず.


$gem --version
0.8.11
幸運にも,gem,Railsのインストール中にアップデートは無かったようです.


これでgem,Railsのインストールはおしまい!続きは後日書く事にします.