InstallRailsWindows » 履歴 » バージョン 92
Yuumi Yoshida, 2015-08-03 22:24
| 1 | 92 | Yuumi Yoshida | # Ruby on Rails 開発環境の作り方(Windows 7) |
|---|---|---|---|
| 2 | 1 | Yuumi Yoshida | |
| 3 | 90 | Yuumi Yoshida | _2015/07/01更新_ |
| 4 | 1 | Yuumi Yoshida | |
| 5 | |||
| 6 | 92 | Yuumi Yoshida | ## WindowsPCの仕様 |
| 7 | |||
| 8 | 41 | Yuumi Yoshida | * メモリー : 1Gbyte以上 |
| 9 | 51 | Yuumi Yoshida | * ディスク空き容量: 500Mbyte以上 |
| 10 | 1 | Yuumi Yoshida | * CPUの性能: 制限はありませんが、ここ3年以内に作られたPCが望ましい |
| 11 | 82 | Yuumi Yoshida | * OS: Windows 7, 8 |
| 12 | 1 | Yuumi Yoshida | |
| 13 | 92 | Yuumi Yoshida | ## インストール |
| 14 | 25 | Yuumi Yoshida | |
| 15 | 1 | Yuumi Yoshida | |
| 16 | 92 | Yuumi Yoshida | ### 1. RailsInstaller |
| 17 | 83 | Yuumi Yoshida | |
| 18 | 92 | Yuumi Yoshida | http://railsinstaller.org/ の **WINDOWS RUBY2.1** をダウンロドし、実行して下さい。 |
| 19 | 1 | Yuumi Yoshida | |
| 20 | 92 | Yuumi Yoshida | |
| 21 | 83 | Yuumi Yoshida | * よくあるアプリのインストーラーが起動されるので、ライセンスの同意等を行って下さい |
| 22 | * 設定項目はデフォルトのまま使って下さい |
||
| 23 | * インストーラーが終了すると、コマンドプロンプトが起動され、以下のようにGitで使う名前とメールアドレスを入力して下さい |
||
| 24 | 92 | Yuumi Yoshida | * **DL is deprecated, please use Fiddle** と表示されますが無視してかまいません |
| 25 | 83 | Yuumi Yoshida | |
| 26 | 92 | Yuumi Yoshida | ~~~ |
| 27 | 83 | Yuumi Yoshida | Please enter your name, for example mine is: Wayne E. Seguin |
| 28 | name > Yuumi Yoshida ← 名前を入力、半角で入力して下さい |
||
| 29 | 1 | Yuumi Yoshida | Setting user.name to Yuumi Yoshida |
| 30 | 83 | Yuumi Yoshida | |
| 31 | Please enter your email address, for example mine is: wayneeseguin@gmail.com |
||
| 32 | email > yy@ey-office.com ← メールアドレスを入力して下さい |
||
| 33 | Setting user.email to yy@ey-office.com |
||
| 34 | 92 | Yuumi Yoshida | ~~~ |
| 35 | 83 | Yuumi Yoshida | |
| 36 | 1 | Yuumi Yoshida | * 以下のバージョンの Ruby と Rails がインストールされます |
| 37 | 83 | Yuumi Yoshida | |
| 38 | 92 | Yuumi Yoshida | ~~~ |
| 39 | 83 | Yuumi Yoshida | ruby: |
| 40 | 1 | Yuumi Yoshida | bin: C:/RailsInstaller/Ruby2.0.0/bin/ruby.exe |
| 41 | 83 | Yuumi Yoshida | version: ruby 2.1.5p273 (2014-11-13 revision 48405) [i386-mingw32] |
| 42 | |||
| 43 | 1 | Yuumi Yoshida | rails: |
| 44 | bin: C:/RailsInstaller/Ruby2.0.0/bin/rails.bat |
||
| 45 | 83 | Yuumi Yoshida | version: Rails 4.1.8 |
| 46 | 92 | Yuumi Yoshida | ~~~ |
| 47 | 1 | Yuumi Yoshida | |
| 48 | 83 | Yuumi Yoshida | * Gitで使うかもしれない ssh の公開キーが表示されます。GitHub等を使う予定があればメモしておいて下さい。 |
| 49 | |||
| 50 | 1 | Yuumi Yoshida | |
| 51 | 92 | Yuumi Yoshida | ### 2. Railsのアップデート、RSpecのインストール |
| 52 | 90 | Yuumi Yoshida | |
| 53 | 84 | Yuumi Yoshida | Ruby on Rails を最新版にアップデートします、コマンドプロンプトから以下のコマンドを実行します。 |
| 54 | 1 | Yuumi Yoshida | |
| 55 | 92 | Yuumi Yoshida | |
| 56 | ~~~ |
||
| 57 | 1 | Yuumi Yoshida | gem update -N --system |
| 58 | 84 | Yuumi Yoshida | gem install rspec -N |
| 59 | 1 | Yuumi Yoshida | gem update rails -N |
| 60 | 92 | Yuumi Yoshida | ~~~ |
| 61 | 84 | Yuumi Yoshida | |
| 62 | 1 | Yuumi Yoshida | もし以下のようなエラーが表示される場合は、3. 手順でSSL証明書を追加してから再度アップデートを実行して下さい。 |
| 63 | |||
| 64 | 92 | Yuumi Yoshida | |
| 65 | ~~~ |
||
| 66 | 1 | Yuumi Yoshida | ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) |
| 67 | SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certif |
||
| 68 | icate verify failed (https://api.rubygems.org/specs.4.8.gz) |
||
| 69 | 92 | Yuumi Yoshida | ~~~ |
| 70 | 84 | Yuumi Yoshida | |
| 71 | Ruby on Rails の確認、以下のように表示されればOKです。 |
||
| 72 | 92 | Yuumi Yoshida | |
| 73 | ~~~ |
||
| 74 | 75 | Yuumi Yoshida | C:\> rails -v |
| 75 | 1 | Yuumi Yoshida | Rails 4.2.3 |
| 76 | 92 | Yuumi Yoshida | ~~~ |
| 77 | 1 | Yuumi Yoshida | |
| 78 | 92 | Yuumi Yoshida | **DL is deprecated, please use Fiddle** という警告が表示されますが、問題ありません。 |
| 79 | 69 | Yuumi Yoshida | |
| 80 | 1 | Yuumi Yoshida | |
| 81 | 92 | Yuumi Yoshida | ### 3. SSL証明書を追加 |
| 82 | |||
| 83 | 81 | Yuumi Yoshida | https://gist.github.com/luislavena/f064211759ee0f806c88#step-1-obtain-the-new-trust-certificate ページを表示し、 |
| 84 | 86 | Yuumi Yoshida | |
| 85 | 92 | Yuumi Yoshida | **AddTrustExternalCARoot-2048.pem** リンクを右クリックし「対象をファイルに保存」で |
| 86 | |||
| 87 | |||
| 88 | **C:\RailsInstaller\Ruby2.1.0\lib\ruby\2.1.0\rubygems\ssl_certs** フォルダーに |
||
| 89 | |||
| 90 | 84 | Yuumi Yoshida | AddTrustExternalCARoot-2048.pem ファイルを保存します。 |
| 91 | 1 | Yuumi Yoshida | |
| 92 | |||
| 93 | |||
| 94 | 92 | Yuumi Yoshida | ### 4. 関連ライブラリーのインストール |
| 95 | |||
| 96 | 1 | Yuumi Yoshida | Ruby on Railsでは初めてプロジェクトを作った際に関連するライブラリーがインストールされるので、一度ダミーのプロジェクトを作成します。 |
| 97 | |||
| 98 | 92 | Yuumi Yoshida | |
| 99 | ~~~ |
||
| 100 | 72 | Yuumi Yoshida | C:\> cd C:\temp |
| 101 | 1 | Yuumi Yoshida | C:\temp> rails new dummy |
| 102 | create |
||
| 103 | 72 | Yuumi Yoshida | create README.rdoc |
| 104 | 78 | Yuumi Yoshida | create Rakefile |
| 105 | |||
| 106 | ... |
||
| 107 | 72 | Yuumi Yoshida | |
| 108 | 69 | Yuumi Yoshida | Your bundle is complete! |
| 109 | Use `bundle show [gemname]` to see where a bundled gem is installed. |
||
| 110 | 92 | Yuumi Yoshida | ~~~ |
| 111 | 1 | Yuumi Yoshida | |
| 112 | |||
| 113 | 78 | Yuumi Yoshida | 削除出来たら、ダミーのプロジェクトは削除してしまってかまいません。 |
| 114 | |||
| 115 | |||
| 116 | 92 | Yuumi Yoshida | ### 5. Node.js のインストール |
| 117 | |||
| 118 | 1 | Yuumi Yoshida | Ruby on RailsはJavaScriptの処理でJavaScriptの実行環境が必要になりますので、Node.jsをインストールする必要があります。 |
| 119 | |||
| 120 | 90 | Yuumi Yoshida | |
| 121 | 92 | Yuumi Yoshida | https://nodejs.org/download/ から、Windows環境に応じ32bitまたは64bitの `Windows Installer (.msi)` をダウンロードしインストールして下さい。 |
| 122 | 91 | Yuumi Yoshida | |
| 123 | 92 | Yuumi Yoshida | インストール時にNode.js環境がPATH環境変数に追加されるので、 **既に開いていたコマンドプロンプトは閉じて、新たにコマンドプロンプトを実行して下さい。** |
| 124 | |||
| 125 | |||
| 126 | ### 6. エディター |
||
| 127 | |||
| 128 | 90 | Yuumi Yoshida | Ruby on Railsのプログラミングでは複数のファイルを編集しながら作業しますので、複数のファイルが編集しやすいエディターを使って下さい。 |
| 129 | |||
| 130 | 92 | Yuumi Yoshida | |
| 131 | オープンソースで高機能なプログラミング用エディター **Atom** https://atom.io がお勧めです。 |