InstallRailsWindows » 履歴 » バージョン 49
Yuumi Yoshida, 2011-08-03 19:02
| 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 | 41 | Yuumi Yoshida | h2. WindowsPCの仕様 |
| 9 | |||
| 10 | * メモリー : 512Mbyte以上 (1Gbyte以上が望ましい) |
||
| 11 | * ディスク空き容量: 300Mbyte以上 |
||
| 12 | * CPUの性能: 制限はありませんが、ここ3年以内に作られたPCが望ましい |
||
| 13 | 44 | Yuumi Yoshida | * OS: Windows XP 以降 |
| 14 | 41 | Yuumi Yoshida | |
| 15 | 25 | Yuumi Yoshida | h2. インストール |
| 16 | 1 | Yuumi Yoshida | |
| 17 | |||
| 18 | 25 | Yuumi Yoshida | |
| 19 | h3. 1-a. Ruby |
||
| 20 | |||
| 21 | |||
| 22 | 46 | Yuumi Yoshida | http://rubyinstaller.org/ のDownload ページから "Ruby 1.8.7-p352":http://rubyforge.org/frs/download.php/75107/rubyinstaller-1.8.7-p352.exe をダウンロドしインストールして下さい。 |
| 23 | 26 | Yuumi Yoshida | |
| 24 | 1 | Yuumi Yoshida | *注意点* : |
| 25 | 25 | Yuumi Yoshida | * インストール先ディレクトリーは C:¥Ruby や D:¥Ruby のような判りやすいところにして下さい。 -C:¥Program Files¥Ruby- はトラブルにつながる可能性がありますので止めましょう。 |
| 26 | 49 | Yuumi Yoshida | * Add Ruby executables to your PATH をチェックして下さい。他のオプションはチェックしないで下さい。 |
| 27 | 37 | Yuumi Yoshida | |
| 28 | 1 | Yuumi Yoshida | h3. 1-b. Rubyの動作確認 |
| 29 | 25 | Yuumi Yoshida | |
| 30 | |||
| 31 | コマンドプロンプトを起動し ruby -v を実行し、以下のように表示されればOKです。 |
||
| 32 | <pre> |
||
| 33 | 1 | Yuumi Yoshida | C:\>ruby -v |
| 34 | 46 | Yuumi Yoshida | ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32] |
| 35 | 36 | Yuumi Yoshida | </pre> |
| 36 | 25 | Yuumi Yoshida | |
| 37 | 1 | Yuumi Yoshida | |
| 38 | h3. 2-a. SQLite3 のインストール |
||
| 39 | 25 | Yuumi Yoshida | |
| 40 | |||
| 41 | 今回は、とても簡単に扱えるデータベース "SQLite3":http://www.sqlite.org/index.html を使います。 |
||
| 42 | |||
| 43 | 49 | Yuumi Yoshida | コマンド http://www.sqlite.org/sqlite-shell-win32-x86-3070701.zip と DLL http://www.sqlite.org/sqlite-dll-win32-x86-3070701.zip をダウンロードし展開(解凍)します。 |
| 44 | 1 | Yuumi Yoshida | |
| 45 | zip ファイルの中にあった、 sqlite3.exe, sqlite3.dll は C:¥Ruby¥bin (他の場所にRubyをインストールした場合は適宜よみかえて下さい)にコピーします。 |
||
| 46 | |||
| 47 | sqlite3.def は不要です。 |
||
| 48 | |||
| 49 | |||
| 50 | h3. 2-b. SQLite3 の確認 |
||
| 51 | 25 | Yuumi Yoshida | |
| 52 | |||
| 53 | 1 | Yuumi Yoshida | コマンドプロンプトで以下のようなコマンドを実行してみましょう。 以下のような表示が出ればOKです。 |
| 54 | |||
| 55 | <pre> |
||
| 56 | 25 | Yuumi Yoshida | C:\Temp>sqlite3 test |
| 57 | 46 | Yuumi Yoshida | SQLite version 3.7.7.1 2011-06-28 17:39:0 |
| 58 | 44 | Yuumi Yoshida | Enter ".help" for instructions |
| 59 | 46 | Yuumi Yoshida | Enter SQL statements terminated with a "; |
| 60 | sqlite> |
||
| 61 | 1 | Yuumi Yoshida | sqlite> .exit ← .exit で sqlite3 コマンドから抜ける |
| 62 | |||
| 63 | 2 | Yuumi Yoshida | C:\Temp> |
| 64 | 25 | Yuumi Yoshida | </pre> |
| 65 | 2 | Yuumi Yoshida | |
| 66 | |||
| 67 | 33 | Yuumi Yoshida | h3. 3. gem コマンドのバージョンアップ |
| 68 | 1 | Yuumi Yoshida | |
| 69 | 33 | Yuumi Yoshida | Rubyライブラリーの管理コマンド gem を最新バージョンにしておきます。 |
| 70 | 1 | Yuumi Yoshida | |
| 71 | <pre> |
||
| 72 | 33 | Yuumi Yoshida | C:\Temp> gem update --system |
| 73 | </pre> |
||
| 74 | |||
| 75 | 1 | Yuumi Yoshida | |
| 76 | 33 | Yuumi Yoshida | h3. 4. Ruby用 SQLite3ドライバーソフトのインストール |
| 77 | 1 | Yuumi Yoshida | |
| 78 | 33 | Yuumi Yoshida | gem (Ruby Gems) からインストールします。コマンドプロンプトで以下のようなコマンドを実行してみましょう (終了するまで時間がかかるかもしれません)。 |
| 79 | |||
| 80 | <pre> |
||
| 81 | 43 | Yuumi Yoshida | C:\Temp> gem install sqlite3-ruby --no-rdoc --no-ri |
| 82 | 1 | Yuumi Yoshida | </pre> |
| 83 | 33 | Yuumi Yoshida | |
| 84 | 2 | Yuumi Yoshida | h3. 5. Rails のインストール |
| 85 | |||
| 86 | 33 | Yuumi Yoshida | Rails , Rake を gem (Ruby Gems) からインストールします。コマンドプロンプトで以下のようなコマンドを実行してみましょう (あるていど時間がかかります)。 |
| 87 | 25 | Yuumi Yoshida | |
| 88 | 1 | Yuumi Yoshida | <pre> |
| 89 | C:\Temp> gem install rake --no-rdoc --no-ri |
||
| 90 | C:\Temp> gem install rails --no-rdoc --no-ri |
||
| 91 | 47 | Yuumi Yoshida | |
| 92 | 1 | Yuumi Yoshida | </pre> |
| 93 | 39 | Yuumi Yoshida | |
| 94 | 47 | Yuumi Yoshida | * WARNING: abstract-1.0.0 has an invalid nil value for @cert_chain という警告がでますがOKです。 |
| 95 | * 今回はrdocのインストールは行いません |
||
| 96 | 25 | Yuumi Yoshida | |
| 97 | 39 | Yuumi Yoshida | |
| 98 | 25 | Yuumi Yoshida | h2. その他の準備 |
| 99 | 3 | Yuumi Yoshida | |
| 100 | 6 | Yuumi Yoshida | |
| 101 | 48 | Yuumi Yoshida | Ruby (Ruby on Rails) の開発はWindowsの 「メモ帳」でも出来ますが、Notepad++ や サクラエディタ、秀丸(シェアウェア)などのプログラミング向きのエデイタ ソフトをインストールしておくと良いと思います。 |
| 102 | 25 | Yuumi Yoshida | |
| 103 | |||
| 104 | h2. 質問 |
||
| 105 | 24 | Yuumi Yoshida | |
| 106 | 6 | Yuumi Yoshida | |
| 107 | 1 | Yuumi Yoshida | ご質問のある方は、"私のBlog":http://d.hatena.ne.jp/yuum3/comment?date=20080607#c にコメント願います。 |