Ruby on Rails をWindows7(64bit)にインストールする

Railsが流行っているから簡単にできるのかと思ったら、意外に手間取った。

  1. http://rubyinstaller.org/ から、Ruby 2.0.0-p481 (x64)をダウンロードしてインストール
    インストールするパスはデフォルトの c:\ruby200-x64 にした。パスに空白が入らない方が無難らしい。
  2. 同様に、 http://rubyinstaller.org/ から、DEVELOPMENT KIT なるものをダウンロード。この時、64bit版を選ばないといけないので注意する。
  3. ダウンロードしたDEVELOPMENT KITは実行形式の圧縮ファイルなので解凍する。解凍先のパスは、 c:\ruby200-x64\devkit とした。
  4. Rubyコンソールを立ち上げる。まずはプロキシを設定する。プロキシが無ければ指定は不要。
    c:\ruby200-x64\devkit> set HTTP_PROXY=http://[USER]:[PASSWORD]@proxyhost:8080
    
  5. 続けて以下を実行
    c:\ruby200-x64\devkit> ruby dk.rb init
    c:\ruby200-x64\devkit> ruby dk.rb install
    
  6. これでようやく Rails をインストールできるようになる。
    c:\ruby200-x64\devkit> gem install rails --no-ri --no-rdoc
    Fetching: i18n-0.6.9.gem (100%)
    Successfully installed i18n-0.6.9
    Fetching: thread_safe-0.3.4.gem (100%)
    Successfully installed thread_safe-0.3.4
    Fetching: tzinfo-1.2.0.gem (100%)
    Successfully installed tzinfo-1.2.0
    Fetching: minitest-5.3.4.gem (100%)
    Successfully installed minitest-5.3.4
    Fetching: activesupport-4.1.1.gem (100%)
    Successfully installed activesupport-4.1.1
    Fetching: rack-1.5.2.gem (100%)
    Successfully installed rack-1.5.2
    Fetching: rack-test-0.6.2.gem (100%)
    Successfully installed rack-test-0.6.2
    Fetching: builder-3.2.2.gem (100%)
    Successfully installed builder-3.2.2
    Fetching: erubis-2.7.0.gem (100%)
    Successfully installed erubis-2.7.0
    Fetching: actionview-4.1.1.gem (100%)
    Successfully installed actionview-4.1.1
    Fetching: actionpack-4.1.1.gem (100%)
    Successfully installed actionpack-4.1.1
    Fetching: activemodel-4.1.1.gem (100%)
    Successfully installed activemodel-4.1.1
    Fetching: arel-5.0.1.20140414130214.gem (100%)
    Successfully installed arel-5.0.1.20140414130214
    Fetching: activerecord-4.1.1.gem (100%)
    Successfully installed activerecord-4.1.1
    Fetching: mime-types-1.25.1.gem (100%)
    Successfully installed mime-types-1.25.1
    Fetching: polyglot-0.3.5.gem (100%)
    Successfully installed polyglot-0.3.5
    Fetching: treetop-1.4.15.gem (100%)
    Successfully installed treetop-1.4.15
    Fetching: mail-2.5.4.gem (100%)
    Successfully installed mail-2.5.4
    Fetching: actionmailer-4.1.1.gem (100%)
    Successfully installed actionmailer-4.1.1
    Fetching: thor-0.19.1.gem (100%)
    Successfully installed thor-0.19.1
    Fetching: railties-4.1.1.gem (100%)
    Successfully installed railties-4.1.1
    Fetching: bundler-1.6.2.gem (100%)
    Successfully installed bundler-1.6.2
    Fetching: hike-1.2.3.gem (100%)
    Successfully installed hike-1.2.3
    Fetching: multi_json-1.10.1.gem (100%)
    Successfully installed multi_json-1.10.1
    Fetching: tilt-1.4.1.gem (100%)
    Successfully installed tilt-1.4.1
    Fetching: sprockets-2.12.1.gem (100%)
    Successfully installed sprockets-2.12.1
    Fetching: sprockets-rails-2.1.3.gem (100%)
    Successfully installed sprockets-rails-2.1.3
    Fetching: rails-4.1.1.gem (100%)
    Successfully installed rails-4.1.1
    28 gems installed
    
    ちなみに、--no-ri --no-rdocは、ドキュメントをインストールしないオプション。これを指定しないとインストール途中でエラーになった。ドキュメントは都度ググればいいので、インストールしないオプションを指定。完了までにしばらくかかる。
  7. 最後に確認。
    c:\ruby200-x64\devkit> rails -v
    DL is deprecated, please use Fiddle
    Rails 4.1.1
    
    警告が出るけれど、とりあえず無視。DLというコマンドが廃止されたらしいけど。
  8. 完了!

コメント

このブログの人気の投稿

svnをバッチジョブから実行するときの認証を解決する

Windows Update で Cisco Anyconnect が繋がらなくなる。(Windows8.1)

Windows8.1 から Cisco AnyConnectを使う