InstallRailsWindows » 履歴 » バージョン 43
Yuumi Yoshida, 2010-02-28 01:32
| 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 | * OS: Windows XP |
||
| 14 | |||
| 15 | 25 | Yuumi Yoshida | h2. インストール |
| 16 | 1 | Yuumi Yoshida | |
| 17 | |||
| 18 | 25 | Yuumi Yoshida | |
| 19 | h3. 1-a. Ruby |
||
| 20 | |||
| 21 | |||
| 22 | 43 | Yuumi Yoshida | http://rubyinstaller.org/ のDownload ページから Ruby 1.8.7-p249 (RC2) をダウンロドしインストールして下さい。 |
| 23 | 26 | Yuumi Yoshida | |
| 24 | 1 | Yuumi Yoshida | *注意点* : |
| 25 | 25 | Yuumi Yoshida | * インストール先ディレクトリーは C:¥Ruby や D:¥Ruby のような判りやすいところにして下さい。 -C:¥Program Files¥Ruby- はトラブルにつながる可能性がありますので止めましょう。 |
| 26 | 43 | 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 | 43 | Yuumi Yoshida | ruby 1.8.7 (2010-01-10 patchlevel 249) [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 | 43 | Yuumi Yoshida | コマンド http://www.sqlite.org/sqlite-3_6_22.zip と DLL sqlitedll-3_6_22.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 | 25 | Yuumi Yoshida | <pre> |
| 56 | 21 | Yuumi Yoshida | C:\Temp>sqlite3 test |
| 57 | 43 | Yuumi Yoshida | SQLite version 3.6.22 |
| 58 | 1 | Yuumi Yoshida | Enter ".help" for instructions |
| 59 | 38 | Yuumi Yoshida | Enter SQL statements terminated with a ";" |
| 60 | 1 | Yuumi Yoshida | sqlite> .exit ← .exit で sqlite3 コマンドから抜ける |
| 61 | |||
| 62 | 2 | Yuumi Yoshida | C:\Temp> |
| 63 | 25 | Yuumi Yoshida | </pre> |
| 64 | 2 | Yuumi Yoshida | |
| 65 | |||
| 66 | 33 | Yuumi Yoshida | h3. 3. gem コマンドのバージョンアップ |
| 67 | 1 | Yuumi Yoshida | |
| 68 | 33 | Yuumi Yoshida | Rubyライブラリーの管理コマンド gem を最新バージョンにしておきます。 |
| 69 | 1 | Yuumi Yoshida | |
| 70 | <pre> |
||
| 71 | 33 | Yuumi Yoshida | C:\Temp> gem update --system |
| 72 | </pre> |
||
| 73 | |||
| 74 | 1 | Yuumi Yoshida | |
| 75 | 33 | Yuumi Yoshida | h3. 4. Ruby用 SQLite3ドライバーソフトのインストール |
| 76 | 1 | Yuumi Yoshida | |
| 77 | 33 | Yuumi Yoshida | gem (Ruby Gems) からインストールします。コマンドプロンプトで以下のようなコマンドを実行してみましょう (終了するまで時間がかかるかもしれません)。 |
| 78 | |||
| 79 | <pre> |
||
| 80 | 43 | Yuumi Yoshida | C:\Temp> gem install sqlite3-ruby --no-rdoc --no-ri |
| 81 | 1 | Yuumi Yoshida | </pre> |
| 82 | 33 | Yuumi Yoshida | |
| 83 | 2 | Yuumi Yoshida | h3. 5. Rails のインストール |
| 84 | |||
| 85 | 33 | Yuumi Yoshida | Rails , Rake を gem (Ruby Gems) からインストールします。コマンドプロンプトで以下のようなコマンドを実行してみましょう (あるていど時間がかかります)。 |
| 86 | 25 | Yuumi Yoshida | |
| 87 | 26 | Yuumi Yoshida | <pre> |
| 88 | 43 | Yuumi Yoshida | C:\Temp> gem install rake --no-rdoc --no-ri |
| 89 | C:\Temp> gem install rails --no-rdoc --no-ri |
||
| 90 | 1 | Yuumi Yoshida | </pre> |
| 91 | 12 | Yuumi Yoshida | |
| 92 | 39 | Yuumi Yoshida | h3. 6. ドキュメントのインストール |
| 93 | 2 | Yuumi Yoshida | |
| 94 | 39 | Yuumi Yoshida | Ruby のドキュメントは ftp://ftp.ruby-lang.org/pub/ruby/doc/ruby-man-ja-html-20051029.zip はからダウンロードし適当なディレクトリーに展開して下さい。展開して出来たファイルのなかの index.html をブラウザーで表示して下さい。 |
| 95 | 25 | Yuumi Yoshida | |
| 96 | 40 | Yuumi Yoshida | Railsの ドキュメントは http://ey-office.net/redmine/attachments/16 をダウンロードし、適当なディレクトリーに展開して下さい。展開して出来たファイルのなかの index.html をブラウザーで表示して下さい。 |
| 97 | 39 | Yuumi Yoshida | |
| 98 | |||
| 99 | 25 | Yuumi Yoshida | h2. その他の準備 |
| 100 | 3 | Yuumi Yoshida | |
| 101 | 6 | Yuumi Yoshida | |
| 102 | 42 | Yuumi Yoshida | Ruby (Ruby on Rails) の開発はWindowsの 「メモ帳」でも出来ますが、EmEditor Text Editor Free版 や サクラエディタ、秀丸(シェアウェア)などのエデイタ ソフトをインストールしておくと良いと思います。 |
| 103 | 25 | Yuumi Yoshida | |
| 104 | |||
| 105 | h2. 質問 |
||
| 106 | 24 | Yuumi Yoshida | |
| 107 | 6 | Yuumi Yoshida | |
| 108 | 1 | Yuumi Yoshida | ご質問のある方は、"私のBlog":http://d.hatena.ne.jp/yuum3/comment?date=20080607#c にコメント願います。 |