InstallRailsWindows » 履歴 » バージョン 40
Yuumi Yoshida, 2009-04-22 07:30
| 1 | 32 | Yuumi Yoshida | h1. Ruby on Rails 開発環境の作り方(Windows) |
|---|---|---|---|
| 2 | 1 | Yuumi Yoshida | |
| 3 | 25 | Yuumi Yoshida | |
| 4 | 27 | Yuumi Yoshida | WindowsPC で Ruby on Rails の開発できる環境を作ってみましょう。 |
| 5 | 4 | Yuumi Yoshida | 初心者にもインストールが簡単なソフトを選んでみました。 |
| 6 | 1 | Yuumi Yoshida | |
| 7 | |||
| 8 | 25 | Yuumi Yoshida | h2. インストール |
| 9 | 1 | Yuumi Yoshida | |
| 10 | |||
| 11 | 25 | Yuumi Yoshida | |
| 12 | h3. 1-a. Ruby |
||
| 13 | |||
| 14 | |||
| 15 | 30 | Yuumi Yoshida | Ruby以外にパッケージ管理ソフトgemやいくつかのライブラリーが入っている "One-Click Ruby Installer for Windows":http://rubyinstaller.rubyforge.org/wiki/wiki.pl?RubyInstaller を使います。 |
| 16 | 1 | Yuumi Yoshida | |
| 17 | 34 | Yuumi Yoshida | http://rubyforge.org/frs/download.php/47082/ruby186-27_rc2.exe からダウンロードして下さい。 |
| 18 | 26 | Yuumi Yoshida | インストール手順は通常のWindowsソフトと同じです。 |
| 19 | 1 | Yuumi Yoshida | |
| 20 | 29 | Yuumi Yoshida | *注意点* : |
| 21 | 25 | Yuumi Yoshida | * インストール先ディレクトリーは C:¥Ruby や D:¥Ruby のような判りやすいところにして下さい。 -C:¥Program Files¥Ruby- はトラブルにつながる可能性がありますので止めましょう。 |
| 22 | * Choose Components では □ Enable [[RubyGems]] は選択して下さい。他は無くても良いです。 |
||
| 23 | 1 | Yuumi Yoshida | |
| 24 | 37 | Yuumi Yoshida | !RubySetup.png! |
| 25 | |||
| 26 | 1 | Yuumi Yoshida | |
| 27 | 25 | Yuumi Yoshida | h3. 1-b. Rubyの動作確認 |
| 28 | |||
| 29 | |||
| 30 | 1 | Yuumi Yoshida | コマンドプロンプトを起動し ruby -v を実行し、以下のように表示されればOKです。 |
| 31 | 25 | Yuumi Yoshida | <pre> |
| 32 | 1 | Yuumi Yoshida | C:\>ruby -v |
| 33 | 36 | Yuumi Yoshida | ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] |
| 34 | 25 | Yuumi Yoshida | </pre> |
| 35 | 1 | Yuumi Yoshida | |
| 36 | |||
| 37 | 25 | Yuumi Yoshida | h3. 2-a. SQLite3 のインストール |
| 38 | 1 | Yuumi Yoshida | |
| 39 | 25 | Yuumi Yoshida | |
| 40 | 今回は、とても簡単に扱えるデータベース "SQLite3":http://www.sqlite.org/index.html を使います。 |
||
| 41 | |||
| 42 | 35 | Yuumi Yoshida | コマンド http://www.sqlite.org/sqlite-3_6_13.zip と DLL http://www.sqlite.org/sqlitedll-3_6_13.zip をダウンロードし展開(解凍)します。 |
| 43 | 1 | Yuumi Yoshida | |
| 44 | zip ファイルの中にあった、 sqlite3.exe, sqlite3.dll は C:¥Ruby¥bin (他の場所にRubyをインストールした場合は適宜よみかえて下さい)にコピーします。 |
||
| 45 | |||
| 46 | sqlite3.def は不要です。 |
||
| 47 | |||
| 48 | |||
| 49 | 25 | Yuumi Yoshida | h3. 2-b. SQLite3 の確認 |
| 50 | |||
| 51 | |||
| 52 | 1 | Yuumi Yoshida | コマンドプロンプトで以下のようなコマンドを実行してみましょう。 以下のような表示が出ればOKです。 |
| 53 | |||
| 54 | 25 | Yuumi Yoshida | <pre> |
| 55 | 21 | Yuumi Yoshida | C:\Temp>sqlite3 test |
| 56 | 35 | Yuumi Yoshida | SQLite version 3.6.13 |
| 57 | 1 | Yuumi Yoshida | Enter ".help" for instructions |
| 58 | 38 | Yuumi Yoshida | Enter SQL statements terminated with a ";" |
| 59 | 1 | Yuumi Yoshida | sqlite> .exit ← .exit で sqlite3 コマンドから抜ける |
| 60 | |||
| 61 | 2 | Yuumi Yoshida | C:\Temp> |
| 62 | 25 | Yuumi Yoshida | </pre> |
| 63 | 2 | Yuumi Yoshida | |
| 64 | |||
| 65 | 33 | Yuumi Yoshida | h3. 3. gem コマンドのバージョンアップ |
| 66 | 1 | Yuumi Yoshida | |
| 67 | 33 | Yuumi Yoshida | Rubyライブラリーの管理コマンド gem を最新バージョンにしておきます。 |
| 68 | 1 | Yuumi Yoshida | |
| 69 | 33 | Yuumi Yoshida | <pre> |
| 70 | C:\Temp> gem update --system |
||
| 71 | </pre> |
||
| 72 | 1 | Yuumi Yoshida | |
| 73 | |||
| 74 | 33 | Yuumi Yoshida | h3. 4. Ruby用 SQLite3ドライバーソフトのインストール |
| 75 | |||
| 76 | gem (Ruby Gems) からインストールします。コマンドプロンプトで以下のようなコマンドを実行してみましょう (終了するまで時間がかかるかもしれません)。 |
||
| 77 | |||
| 78 | 22 | Yuumi Yoshida | <pre> |
| 79 | 33 | Yuumi Yoshida | C:\Temp> gem install sqlite3-ruby -v 1.2.3 |
| 80 | 25 | Yuumi Yoshida | </pre> |
| 81 | 1 | Yuumi Yoshida | |
| 82 | 38 | Yuumi Yoshida | *注)* 2009/4/22 現在 最新の Version 1.2.4 はWindowsではインストールが失敗するので Version 1.2.3 をインストールします。 |
| 83 | 25 | Yuumi Yoshida | |
| 84 | 33 | Yuumi Yoshida | h3. 5. Rails のインストール |
| 85 | 2 | Yuumi Yoshida | |
| 86 | |||
| 87 | 33 | Yuumi Yoshida | Rails , Rake を gem (Ruby Gems) からインストールします。コマンドプロンプトで以下のようなコマンドを実行してみましょう (あるていど時間がかかります)。 |
| 88 | 25 | Yuumi Yoshida | |
| 89 | 26 | Yuumi Yoshida | <pre> |
| 90 | C:\Temp> gem install rake |
||
| 91 | 25 | Yuumi Yoshida | C:\Temp> gem install rails |
| 92 | 1 | Yuumi Yoshida | </pre> |
| 93 | 12 | Yuumi Yoshida | |
| 94 | 39 | Yuumi Yoshida | h3. 6. ドキュメントのインストール |
| 95 | 2 | Yuumi Yoshida | |
| 96 | 39 | Yuumi Yoshida | Ruby のドキュメントは ftp://ftp.ruby-lang.org/pub/ruby/doc/ruby-man-ja-html-20051029.zip はからダウンロードし適当なディレクトリーに展開して下さい。展開して出来たファイルのなかの index.html をブラウザーで表示して下さい。 |
| 97 | 25 | Yuumi Yoshida | |
| 98 | 40 | Yuumi Yoshida | Railsの ドキュメントは http://ey-office.net/redmine/attachments/16 をダウンロードし、適当なディレクトリーに展開して下さい。展開して出来たファイルのなかの index.html をブラウザーで表示して下さい。 |
| 99 | 39 | Yuumi Yoshida | |
| 100 | |||
| 101 | 25 | Yuumi Yoshida | h2. その他の準備 |
| 102 | 3 | Yuumi Yoshida | |
| 103 | 6 | Yuumi Yoshida | |
| 104 | 25 | Yuumi Yoshida | Ruby (Ruby on Rails) の開発はWindowsの 「メモ帳」でも出来ますが、サクラエディタや秀丸(シェアウェア)などのエデイタ ソフトをインストールしておくと良いと思います。 |
| 105 | |||
| 106 | |||
| 107 | h2. 質問 |
||
| 108 | 24 | Yuumi Yoshida | |
| 109 | 6 | Yuumi Yoshida | |
| 110 | 1 | Yuumi Yoshida | ご質問のある方は、"私のBlog":http://d.hatena.ne.jp/yuum3/comment?date=20080607#c にコメント願います。 |