InstallRailsWindows » 履歴 » バージョン 80
Yuumi Yoshida, 2014-06-03 16:27
| 1 | 69 | Yuumi Yoshida | h1. Ruby on Rails 開発環境の作り方(Windows 7) |
|---|---|---|---|
| 2 | 1 | Yuumi Yoshida | |
| 3 | 79 | Yuumi Yoshida | _2014/06/03更新_ |
| 4 | 1 | Yuumi Yoshida | |
| 5 | h2. WindowsPCの仕様 |
||
| 6 | 41 | Yuumi Yoshida | |
| 7 | * メモリー : 1Gbyte以上 |
||
| 8 | 51 | Yuumi Yoshida | * ディスク空き容量: 500Mbyte以上 |
| 9 | 41 | Yuumi Yoshida | * CPUの性能: 制限はありませんが、ここ3年以内に作られたPCが望ましい |
| 10 | 69 | Yuumi Yoshida | * OS: Windows 7 |
| 11 | 1 | Yuumi Yoshida | |
| 12 | 41 | Yuumi Yoshida | h2. インストール |
| 13 | 25 | Yuumi Yoshida | |
| 14 | 1 | Yuumi Yoshida | |
| 15 | 25 | Yuumi Yoshida | h3. 1. Ruby |
| 16 | 52 | Yuumi Yoshida | |
| 17 | 25 | Yuumi Yoshida | |
| 18 | 79 | Yuumi Yoshida | http://rubyinstaller.org/ のDownload ページから *Ruby 2.0.0-p481* をダウンロドし、実行して下さい。 |
| 19 | 25 | Yuumi Yoshida | |
| 20 | 57 | Yuumi Yoshida | # 最初の画面でライセンスに同意(I accept the License) |
| 21 | 51 | Yuumi Yoshida | # 次の画面でインストル先とオプションを選択します。 |
| 22 | 69 | Yuumi Yoshida | ** インストル先は C:\Ruby200 や D:\Ruby200 にして下さい。 |
| 23 | 51 | Yuumi Yoshida | ** Add Ruby excutables to your PATH をチェックして下さい |
| 24 | 1 | Yuumi Yoshida | !rubyInstaller.png! |
| 25 | # Installボタンを押す |
||
| 26 | 52 | Yuumi Yoshida | |
| 27 | h3. 2. DEVELOPMENT KIT |
||
| 28 | 1 | Yuumi Yoshida | |
| 29 | OSに依存したライブラリーをWindows環境にインストールする為のツールもインストールします |
||
| 30 | |||
| 31 | 69 | Yuumi Yoshida | http://rubyinstaller.org/ のDownload ページから *DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe* をダウンロドし、実行して下さい。 |
| 32 | 1 | Yuumi Yoshida | |
| 33 | 69 | Yuumi Yoshida | ファイルを展開するディレクトリーを入力するダイアログが表示されるので、1.で指定したRubyのインストール先に DevKitディレクトリーを作成し (例 C:\Ruby200\DevKit) を指定して下さい。 |
| 34 | 1 | Yuumi Yoshida | |
| 35 | |||
| 36 | h3. 3. Rubyの確認とDEVELOPMENT KITのインストール作業 |
||
| 37 | |||
| 38 | コマンドプロンプトを起動し ruby -v を実行し、以下のように表示されればOKです。 |
||
| 39 | <pre> |
||
| 40 | 52 | Yuumi Yoshida | C:\>ruby -v |
| 41 | 79 | Yuumi Yoshida | ruby 2.0.0p481 .... |
| 42 | 1 | Yuumi Yoshida | </pre> |
| 43 | |||
| 44 | 次に、DEVELOPMENT KITのインストール作業をコマンドプロンプトで行います。 |
||
| 45 | <pre> |
||
| 46 | 69 | Yuumi Yoshida | C:\> cd \Ruby200\DevKit |
| 47 | |||
| 48 | C:\Ruby200\DevKit> ruby dk.rb init |
||
| 49 | [INFO] found RubyInstaller v2.0.0 at C:/Ruby200 |
||
| 50 | 52 | Yuumi Yoshida | ..... |
| 51 | 1 | Yuumi Yoshida | |
| 52 | 69 | Yuumi Yoshida | C:\Ruby200\DevKit> ruby dk.rb install |
| 53 | [INFO] Installing 'C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/defaults/operating_system.rb' |
||
| 54 | ..... |
||
| 55 | 1 | Yuumi Yoshida | |
| 56 | 69 | Yuumi Yoshida | </pre> |
| 57 | 1 | Yuumi Yoshida | |
| 58 | |||
| 59 | 69 | Yuumi Yoshida | h3. 4. Ruby on Rails のインストール |
| 60 | 1 | Yuumi Yoshida | |
| 61 | 69 | Yuumi Yoshida | 引き続きコマンドプロンプトで、gemコマンドの更新を行います。 |
| 62 | 1 | Yuumi Yoshida | 次に Ruby on Railsをインストールします。 ある程度時間がかかります。 |
| 63 | |||
| 64 | <pre> |
||
| 65 | 69 | Yuumi Yoshida | C:\> gem update --system -N |
| 66 | 1 | Yuumi Yoshida | ... |
| 67 | |||
| 68 | 69 | Yuumi Yoshida | C:\> gem install bundler -N |
| 69 | ... |
||
| 70 | 1 | Yuumi Yoshida | |
| 71 | 71 | Yuumi Yoshida | C:\> gem install rspec -N |
| 72 | ... |
||
| 73 | |||
| 74 | 75 | Yuumi Yoshida | C:\>gem install rails -N |
| 75 | 69 | Yuumi Yoshida | .... |
| 76 | |||
| 77 | </pre> |
||
| 78 | |||
| 79 | 52 | Yuumi Yoshida | Ruby on Rails の確認、以下のように表示されればOKです。 |
| 80 | 1 | Yuumi Yoshida | <pre> |
| 81 | 69 | Yuumi Yoshida | C:\> rails -v |
| 82 | 79 | Yuumi Yoshida | Rails 4.1.1 |
| 83 | 2 | Yuumi Yoshida | </pre> |
| 84 | 33 | Yuumi Yoshida | |
| 85 | 80 | Yuumi Yoshida | @DL is deprecated, please use Fiddle@ という警告が表示されますが、問題ありません。 |
| 86 | |||
| 87 | 72 | Yuumi Yoshida | h3. 5. 関連ライブラリーのインストール |
| 88 | 1 | Yuumi Yoshida | |
| 89 | 72 | Yuumi Yoshida | Ruby on Railsでは初めてプロジェクトを作った際に関連するライブラリーがインストールされるので、一度ダミーのプロジェクトを作成します。 |
| 90 | |||
| 91 | <pre> |
||
| 92 | C:\> cd C:\temp |
||
| 93 | C:\temp> rails new dummy |
||
| 94 | 78 | Yuumi Yoshida | create |
| 95 | create README.rdoc |
||
| 96 | create Rakefile |
||
| 97 | |||
| 98 | ... |
||
| 99 | |||
| 100 | Your bundle is complete! |
||
| 101 | Use `bundle show [gemname]` to see where a bundled gem is installed. |
||
| 102 | 72 | Yuumi Yoshida | </pre> |
| 103 | 69 | Yuumi Yoshida | |
| 104 | |||
| 105 | 削除出来たら、ダミーのプロジェクトは削除してしまってかまいません。 |
||
| 106 | 1 | Yuumi Yoshida | |
| 107 | |||
| 108 | 78 | Yuumi Yoshida | h3. その他. |
| 109 | |||
| 110 | 多数の PCにインストールする場合、 |
||
| 111 | 1 | Yuumi Yoshida | |
| 112 | 69 | Yuumi Yoshida | 1台で上の作業を行った後、C:\Ruby200 ディレクトリーを他のPCにコピーし、環境変数 Path に C:\Ruby200\bin を追加すれば、他のPCでもRuby on Rails使えるようになります。 |