InstallRailsUbuntu » 履歴 » バージョン 6
Yuumi Yoshida, 2012-07-01 01:51
| 1 | 2 | Yuumi Yoshida | h1. Ruby on Rails 開発環境の作り方 (Ubuntu) |
|---|---|---|---|
| 2 | 1 | Yuumi Yoshida | |
| 3 | 3 | Yuumi Yoshida | この手順は Ubuntu.12.04 で確認しました。 |
| 4 | 2 | Yuumi Yoshida | |
| 5 | ここでは、複数の ruby や gem ライブラリーセットを切り替えられる rvm(http://beginrescueend.com/ ) を使ったインストール手順を書きます |
||
| 6 | |||
| 7 | 3 | Yuumi Yoshida | h3. 1. 必要なライブラリーのインストール |
| 8 | 2 | Yuumi Yoshida | |
| 9 | 6 | Yuumi Yoshida | 一行で入力して下さい |
| 10 | 1 | Yuumi Yoshida | <pre> |
| 11 | 6 | Yuumi Yoshida | $ sudo apt-get -y install build-essential curl git-core libreadline5 libreadline-dev |
| 12 | zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 |
||
| 13 | 1 | Yuumi Yoshida | </pre> |
| 14 | |||
| 15 | 3 | Yuumi Yoshida | h3. 2. RVM と Ruby 1.9.3 のインストール |
| 16 | 1 | Yuumi Yoshida | |
| 17 | 3 | Yuumi Yoshida | h4. i) rvm + ruby のインストール |
| 18 | 4 | Yuumi Yoshida | |
| 19 | 2 | Yuumi Yoshida | <pre> |
| 20 | 5 | Yuumi Yoshida | $ curl -L https://get.rvm.io | bash -s stable --ruby |
| 21 | 1 | Yuumi Yoshida | </pre> |
| 22 | |||
| 23 | 3 | Yuumi Yoshida | 以下のようなメッセージが表示されたら q をタイプします |
| 24 | 2 | Yuumi Yoshida | <pre> |
| 25 | 3 | Yuumi Yoshida | Ruby (and needed base gems) for your selection will be installed shortly. |
| 26 | Before it happens, please read and execute the instructions below. |
||
| 27 | Please use a separate terminal to execute any additional commands. |
||
| 28 | Press 'q' to continue. |
||
| 29 | (END) |
||
| 30 | 1 | Yuumi Yoshida | </pre> |
| 31 | |||
| 32 | 3 | Yuumi Yoshida | h4. ii) rvm起動スクリプトの設定 |
| 33 | 1 | Yuumi Yoshida | |
| 34 | 3 | Yuumi Yoshida | インストールが修了したら .bashrc の最後に以下の rvmの起動スクリプトを追加します。 |
| 35 | |||
| 36 | 1 | Yuumi Yoshida | <pre> |
| 37 | 3 | Yuumi Yoshida | . $HOME/.rvm/scripts/rvm |
| 38 | 2 | Yuumi Yoshida | </pre> |
| 39 | |||
| 40 | 3 | Yuumi Yoshida | h4. ii) 確認 |
| 41 | 4 | Yuumi Yoshida | |
| 42 | 3 | Yuumi Yoshida | .bashrc変更後に以下を実行 |
| 43 | 2 | Yuumi Yoshida | |
| 44 | <pre> |
||
| 45 | 5 | Yuumi Yoshida | $ source .bashrc |
| 46 | 3 | Yuumi Yoshida | </pre> |
| 47 | |||
| 48 | ここで、ruby -v を実行し ruby 1.9.3 と表示されれば OK |
||
| 49 | |||
| 50 | <pre> |
||
| 51 | 5 | Yuumi Yoshida | $ ruby -v |
| 52 | 3 | Yuumi Yoshida | ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] |
| 53 | 2 | Yuumi Yoshida | </pre> |
| 54 | |||
| 55 | 1 | Yuumi Yoshida | |
| 56 | 4 | Yuumi Yoshida | h3. 3. Ruby on Rails のインストール |
| 57 | |||
| 58 | h4. i) インストール |
||
| 59 | |||
| 60 | 1 | Yuumi Yoshida | <pre> |
| 61 | 5 | Yuumi Yoshida | $ curl -L https://get.rvm.io | bash -s stable --rails |
| 62 | 1 | Yuumi Yoshida | </pre> |
| 63 | |||
| 64 | 4 | Yuumi Yoshida | 以下のようなメッセージが表示されたら q をタイプします |
| 65 | <pre> |
||
| 66 | Ruby (and needed base gems) for your selection will be installed shortly. |
||
| 67 | Before it happens, please read and execute the instructions below. |
||
| 68 | Please use a separate terminal to execute any additional commands. |
||
| 69 | Press 'q' to continue. |
||
| 70 | (END) |
||
| 71 | </pre> |
||
| 72 | 1 | Yuumi Yoshida | |
| 73 | 4 | Yuumi Yoshida | h4. ii) 確認 |
| 74 | |||
| 75 | 1 | Yuumi Yoshida | <pre> |
| 76 | 5 | Yuumi Yoshida | $ rails -v |
| 77 | 4 | Yuumi Yoshida | Rails 3.2.6 |
| 78 | 2 | Yuumi Yoshida | </pre> |
| 79 | |||
| 80 | 4 | Yuumi Yoshida | h4. ii) 追加 gem |
| 81 | |||
| 82 | 5 | Yuumi Yoshida | 以下のコマンドを実行し Javascript実行ライブラリーをインストールします |
| 83 | 4 | Yuumi Yoshida | |
| 84 | <pre> |
||
| 85 | 5 | Yuumi Yoshida | $ gem install therubyracer |
| 86 | 4 | Yuumi Yoshida | </pre> |