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