InstallRailsWindows » 履歴 » バージョン 35
Yuumi Yoshida, 2009-04-22 05:12
| 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 | |||
| 25 | 25 | Yuumi Yoshida | h3. 1-b. Rubyの動作確認 |
| 26 | |||
| 27 | |||
| 28 | 1 | Yuumi Yoshida | コマンドプロンプトを起動し ruby -v を実行し、以下のように表示されればOKです。 |
| 29 | 25 | Yuumi Yoshida | <pre> |
| 30 | 1 | Yuumi Yoshida | C:\>ruby -v |
| 31 | 13 | Yuumi Yoshida | ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] |
| 32 | 25 | Yuumi Yoshida | </pre> |
| 33 | 1 | Yuumi Yoshida | |
| 34 | |||
| 35 | 25 | Yuumi Yoshida | h3. 2-a. SQLite3 のインストール |
| 36 | 1 | Yuumi Yoshida | |
| 37 | 25 | Yuumi Yoshida | |
| 38 | 今回は、とても簡単に扱えるデータベース "SQLite3":http://www.sqlite.org/index.html を使います。 |
||
| 39 | |||
| 40 | 35 | Yuumi Yoshida | コマンド http://www.sqlite.org/sqlite-3_6_13.zip と DLL http://www.sqlite.org/sqlitedll-3_6_13.zip をダウンロードし展開(解凍)します。 |
| 41 | 1 | Yuumi Yoshida | |
| 42 | zip ファイルの中にあった、 sqlite3.exe, sqlite3.dll は C:¥Ruby¥bin (他の場所にRubyをインストールした場合は適宜よみかえて下さい)にコピーします。 |
||
| 43 | |||
| 44 | sqlite3.def は不要です。 |
||
| 45 | |||
| 46 | |||
| 47 | 25 | Yuumi Yoshida | h3. 2-b. SQLite3 の確認 |
| 48 | |||
| 49 | |||
| 50 | 1 | Yuumi Yoshida | コマンドプロンプトで以下のようなコマンドを実行してみましょう。 以下のような表示が出ればOKです。 |
| 51 | |||
| 52 | 25 | Yuumi Yoshida | <pre> |
| 53 | 21 | Yuumi Yoshida | C:\Temp>sqlite3 test |
| 54 | 35 | Yuumi Yoshida | SQLite version 3.6.13 |
| 55 | 1 | Yuumi Yoshida | Enter ".help" for instructions |
| 56 | sqlite> .exit ← .exit で sqlite3 コマンドから抜ける |
||
| 57 | |||
| 58 | 2 | Yuumi Yoshida | C:\Temp> |
| 59 | 25 | Yuumi Yoshida | </pre> |
| 60 | 2 | Yuumi Yoshida | |
| 61 | |||
| 62 | 33 | Yuumi Yoshida | h3. 3. gem コマンドのバージョンアップ |
| 63 | 1 | Yuumi Yoshida | |
| 64 | 33 | Yuumi Yoshida | Rubyライブラリーの管理コマンド gem を最新バージョンにしておきます。 |
| 65 | 1 | Yuumi Yoshida | |
| 66 | 33 | Yuumi Yoshida | <pre> |
| 67 | C:\Temp> gem update --system |
||
| 68 | </pre> |
||
| 69 | 1 | Yuumi Yoshida | |
| 70 | |||
| 71 | 33 | Yuumi Yoshida | h3. 4. Ruby用 SQLite3ドライバーソフトのインストール |
| 72 | |||
| 73 | gem (Ruby Gems) からインストールします。コマンドプロンプトで以下のようなコマンドを実行してみましょう (終了するまで時間がかかるかもしれません)。 |
||
| 74 | |||
| 75 | 22 | Yuumi Yoshida | <pre> |
| 76 | 33 | Yuumi Yoshida | C:\Temp> gem install sqlite3-ruby -v 1.2.3 |
| 77 | 25 | Yuumi Yoshida | </pre> |
| 78 | 1 | Yuumi Yoshida | |
| 79 | 33 | Yuumi Yoshida | *注)* 2008/11/4 現在 最新の Version 1.2.4 はWindowsではインストールが失敗するので Version 1.2.3 をインストールします。 |
| 80 | 25 | Yuumi Yoshida | |
| 81 | 33 | Yuumi Yoshida | h3. 5. Rails のインストール |
| 82 | 2 | Yuumi Yoshida | |
| 83 | |||
| 84 | 33 | Yuumi Yoshida | Rails , Rake を gem (Ruby Gems) からインストールします。コマンドプロンプトで以下のようなコマンドを実行してみましょう (あるていど時間がかかります)。 |
| 85 | 25 | Yuumi Yoshida | |
| 86 | 26 | Yuumi Yoshida | <pre> |
| 87 | C:\Temp> gem install rake |
||
| 88 | 25 | Yuumi Yoshida | C:\Temp> gem install rails |
| 89 | 1 | Yuumi Yoshida | </pre> |
| 90 | 12 | Yuumi Yoshida | |
| 91 | 2 | Yuumi Yoshida | |
| 92 | 25 | Yuumi Yoshida | |
| 93 | h2. その他の準備 |
||
| 94 | |||
| 95 | 3 | Yuumi Yoshida | |
| 96 | 6 | Yuumi Yoshida | Ruby (Ruby on Rails) の開発はWindowsの 「メモ帳」でも出来ますが、サクラエディタや秀丸(シェアウェア)などのエデイタ ソフトをインストールしておくと良いと思います。 |
| 97 | 25 | Yuumi Yoshida | |
| 98 | |||
| 99 | |||
| 100 | h2. 質問 |
||
| 101 | 24 | Yuumi Yoshida | |
| 102 | 6 | Yuumi Yoshida | |
| 103 | 1 | Yuumi Yoshida | ご質問のある方は、"私のBlog":http://d.hatena.ne.jp/yuum3/comment?date=20080607#c にコメント願います。 |