4月 7th, 2008at 16:27

Tags: , ,

Ruby on Rails2.0.2インストール

Windows環境、Ruby1.8.6でやってる。

インストール

コマンドプロンプトで以下を実行。

gem install rails --include-dependencies

依存関係のあるファイルもインストールしてくれる。

Bulk updating Gem source index for: http://gems.rubyforge.orSuccessfully installed rails-2.0.2Successfully installed activesupport-2.0.2Successfully installed activerecord-2.0.2Successfully installed actionpack-2.0.2Successfully installed actionmailer-2.0.2Successfully installed activeresource-2.0.2Installing ri documentation for activesupport-2.0.2...Installing ri documentation for activerecord-2.0.2...Installing ri documentation for actionpack-2.0.2...Installing ri documentation for actionmailer-2.0.2...Installing ri documentation for activeresource-2.0.2...Installing RDoc documentation for activesupport-2.0.2...Installing RDoc documentation for activerecord-2.0.2...Installing RDoc documentation for actionpack-2.0.2...Installing RDoc documentation for actionmailer-2.0.2...Installing RDoc documentation for activeresource-2.0.2...

プロキシの設定が必要な場合

インストール時に

C:\>gem install rails --include-dependenciesERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError) 対象のコンピュータによって拒否されたため、接続できませんでした。 - connect(2)(Errno::ECONNREFUSED)

と怒られた。Railsをインストールするときにネット上にあるファイルをダウンロードしているらしいが、つながらなかったのが問題みたい。プロキシの設定を行ったらうまくいった。

C:\>set HTTP_PROXY=http://porxyのドメイン:ポート番号C:\>gem install rails --include-dependencies

gemファイルを落としてきて手動でもできるみたいだけど、gemファイルを置く場所がわからなくて断念。(参考:http://blog.livedoor.jp/zep716/archives/21956177.html